Q: Periods in {} expression
Brent Pinkney
Brent at astarte.co.nz
Fri Jun 2 06:48:52 UTC 2000
Hi,
Does any one know wht this does not work ?
Evaluate in a worskpace
{ 5 factorial. 4 factorial. 3 factorial } ===> (120 24 6 )
but
{ 5 factorial. 4 factorial. 3 factorial.} gives the error: "Variable or
expression expected -> }
The only difference is the last fullstop (period ?) before the terminating }
Now evaluating just a single lonely fullstop in a workspace compiles and
executes with a result of nil.
Further, evaluating
[ 5 factorial ] value ====> 120
as does
[ 5 factorial. ] value ====> 120 (ie. with the fullstop)
Moreover::
[] value ====> nil
as does
[.] value ====> nil
This would suggest to me that:
1. Smalltalk expression . (just a fullstop) is valid as return nil.
2. {.} should give =====> (nil) ( same as #(nil) )
3. We should be allowed to end a {} expression with a fullstop.
If this is a bug, can I have a go at fixing it ? I would really make my life
easier and my code more elegant and terse.
If is is indeed part of the Masterplan, why is is so ?
Thanks
Brent
More information about the Squeak-dev
mailing list
|