Category:Smalltalk: Difference between revisions

Line 317:
(1+5i) "a complex"
 
'hello'$a "stringcharacter constant; an instance of String"
 
$a "another character constant"
 
'hello' "string constant; an instance of String, a collection of Characters"
 
'öäü こんにちは世界' "string constant; unicode is supported by most implementations"
Line 329 ⟶ 333:
#(1 true $a 16rFF 1.0 (10 20)) "array literal constant; the last element being another array; an instance of Array"
 
#[( 10(a 201) 2r1000(b 16rFE2) ](c 3) ) "byte-array literal constant; an3 instanceelements, ofeach ByteArray"being a two element array;
inside an array constant, symbols can be written without the # prefix"
 
#[ 10 20 2r1000 16rFE ] "byte-array constant; an instance of ByteArray"
$a "character constant"
 
#f32[ 10.0 20.0 ] "float32-array constant; an instance of FloatArray ¹"
 
[ ... some code ... ] "a block literal; an instance of BlockClosure (dialect specific); the object represents the piece of code which can be passed around and evaluated later (a lambda closure)"
 
[:a1 ... :aN | ... some code ...] "a block literal with arguments."</lang>
1) not supported by all dialects.
 
===Special "builtin" Pseudo Veriables===
Anonymous user