yes it is close isn't it. ;-) I had no idea about #fixTemps. This second example has me in knots again. I would think that foo would have seperate bindings, in a full closure system, in the two different blocks.
Stephan Rudlof wrote:
Vassily,
thank you. You have a deep understanding of this - Smalltalk version specific - stuff.
[snip]
Just to check understanding of binding levels:
Method | foo | ^Array with: [:arg | foo := arg] with: [foo]
Squeak BlockContexts: - 'foo' is on the same level as 'arg', Real BlockClosures: - 'foo' is on another level as 'arg'.
The real BlockClosures example here is the one that threw me. I would think there would be three bindings of foo here and only two bindings when the Array is returned.
So let me construct an example: Method |array foo| foo := 10. array := Array with: [:arg | foo := arg] with: nil. foo := 20. array at: 2 put: [foo]. ^array
"Before the return..." {foo}-->20 {array}--> [1, 2] {array at: 1}--> {block} | {foo}--> 10 "arg doesn't have a binding yet
{array at: 2}--> {block} | {foo}--> 20
Is this not our picture? Does it have anything to do with foo on the lhs in the first block?
thanks, Rob
[snip]
Is it correct to say aBlockContext fixTemps in Squeak behaves like a BlockClosure in VW?
Great question!
No. One of the examples I gave in this thread:
| foo | ^Array with: [:arg | foo := arg] with: [foo]
[snip]
"i" and the example works. #fixTemps copies a little too much though--the whole environment frame of the containing method, including variables such as "foo" in the second example. If you add #fixTemps to the example above, blocks would use separate bindings for "foo". Because closures do not copy bindings (at least conceptually), the behaviour is different.
Response and interest in the new fonts was sufficiently great that I spent the evening tweaking the generated fonts for Squeak programming, and added a few more. The virtue, if any, in the new fonts is that they are license-clean, and if satisfactory to replace "New York," will permit us to drop the font-related language in the Squeak license in the core release. (Of course, New York can be filed in thereafter by anyone who prefers it and isn't troubled by the license restrictions).
"Change Set: ComputerModern2-acg Date: 31 January 2000 Author: Andrew C. Greenberg
Squeak fonts derived from Donald Knuth's Computer Modern Fonts.
This fileIn installs a set of fonts derived from CM for use as Squeak screen fonts. The fonts have been modified to incorporate the assignment '_' and return'^' glyphs, non-curly quotation signs, and various symbols used for programming in squeak.
The following font sets are installed on fileIn as Squeak TextStyles, and thus may be selected by using control-K in any text window. Each font has been broken up into TextStyles and FontSets, so that more commonly used sizes will be readily available through use of Cmd-1 through Cmd-5 keys.
Cmcsc Computer Modern Small Caps (10, 12, 14, 16, 18) Cmdun Computer Modern Dunhill (10, 12, 14, 16, 18) Cmr Computer Modern Roman (10, 12, 14, 16, 18) Cmss Computer Modern Sans Serif (10, 12, 14, 16, 18) Cmtt Computer Modern Typewriter (10, 12, 14, 16, 18) (NOT monospaced) Cmcscx Computer Modern Small Caps (6, 8, 20, 22, 24) Cmdunx Computer Modern Dunhill (6, 8, 20, 22, 24) Cmrx Computer Modern Roman (6, 8, 20, 22, 24) Cmssx Computer Modern Sans Serif (6, 8, 20, 22, 24) Cmttx Computer Modern Typewriter (6, 8, 20, 22, 24) (NOT monospaced)
"
squeak-dev@lists.squeakfoundation.org