3 ms·
Squeak kinda does, as it doesn't allow for locals within blocks. Basically a variable is either shared or local. Locals were usually unimplemented or poorly im
by shakna 10y ago
Squeak kinda does, as it doesn't allow for locals within blocks.
Basically a variable is either shared or local. Locals were usually unimplemented or poorly implemented in the past.
As to sharing variables with functions in a namespace, that's implementation defined. A Smalltalk without a longer history probably doesn't do this,because the author/s are usually familiar with languages that don't.
- squeakthrowawy 10y ago>Squeak kinda does, as it doesn't allow for locals within blocks. All Smalltalks allow this by putting the variable names in a pair of "|" after the "[" starting a zero-arg block or the "|" terminating its argument names: [| localVar | ...] [:firstArg | | firstLocalVar | ...] [:firstArg :secondArg | | firstLocalVar secondLocalVar | ...] > Basically a variable is either shared or local. Locals were usually unimplemented or poorly implemented in the past. Traditionally block argument and block local vars shared the same "temp frame" with the method they were defined in, meaning that while indeed local, they were only local to their method, not the block itself. But Squeak, Pharo, Gemstone, VW, all have compilers and VMs that support real closures, where each block introduces a new scope and blocks can be written to evaluate recursively.