GNU Smalltalk: Difference between revisions

→‎Examples: Changed wiki italics back to single quotes
No edit summary
(→‎Examples: Changed wiki italics back to single quotes)
 
(One intermediate revision by one other user not shown)
Line 10:
Some basic Smalltalk code:
 
<pre>"Everything, including a literal, is an object, so this works:"
-199 abs "199"
'gst is cool' size "11"
'Slick' indexOf: $c "4"
'Nice Day Isn''t It?' asLowercase asSet asSortedCollection asString "' '?acdeinsty'"</pre>
 
 
===Collections===
Line 153 ⟶ 154:
self error: 'This is a message'
 
These are actually wrappers for the actual exception raising method, <tt>signal</tt>:
 
Error signal
Error signal: 'Illegal arguments!'
 
Exceptions are handled by <code>on:do:</ttcode> blocks.
 
[ something to do ]
Anonymous user