[Newbies] array literal - a misunderstanding?

Ron Teitelbaum Ron at USMedRec.com
Sun Mar 4 21:58:37 UTC 2007


Hi Thomas,

The #() syntax is for a regular array but for a literal array you want {}
(curly braces) 

Try this: {1. 2. 1 + 3.}

Hope that helps,

Ron Teitelbaum

> From: Thomas Fischer
> 
> 
> Hello list,
> 
> I'm starting for a couple of days with smalltalk/squeak - maybe it's not
> my
> last post  :)
> 
> I like to construct a flat array, but get a nested array:
> 
> #(1 2 (1 + 3))      "unexpected result: #(1 2 #(1 #+ 3)) "
> 
> Why squeak means, that "(1 + 3)" is an array and not 4?
> 
> The syntax for an array literal is defined via"#(" - isn't it?
> 
> salute
> Thomas
> --
> View this message in context: http://www.nabble.com/array-literal---a-
> misunderstanding--tf3344098.html#a9300859
> Sent from the Squeak - Beginners mailing list archive at Nabble.com.
> 
> _______________________________________________
> Beginners mailing list
> Beginners at lists.squeakfoundation.org
> http://lists.squeakfoundation.org/mailman/listinfo/beginners




More information about the Beginners mailing list