3 ms·
call and apply only let you change the meaning of the this pointer in Javascript. You can't change the meaning of other bound variables. In Io, you can take a
by richcollins 17y ago
call and apply only let you change the meaning of the this pointer in Javascript. You can't change the meaning of other bound variables. In Io, you can take a Block and set the scope:
makeOriginalScope := block(name := "originalScope"; block(writeln(name)))
block(name := "newScope"; makeOriginalScope call setScope(thisContext) call) call
//newScope