View this PageEdit this Page (locked)Attachments to this PageHistory of this PageHomeRecent ChangesSearch the SwikiHelp Guide
Hotspots: Admin Pages | Turn-in Site |
Current Links: Cases Final Project Summer 2007

General useful Squeak stuff

This is a dump of all sorts of useful stuff in Squeak that was useful to us during the semester.

See if a instance is of a particular class

self isMemberOf: SketchMorph

See if a instance is of a class or decendent class of

self isKindOf: SketchMorph

Get the class name of a instance

1 class name asString

Get the class category of a instance

1 class category asString

Get the class comment of a instance

1 class comment asString

Browse the code of a instance

1 class browse

Entering the debugger from code

self halt

Opening a inspector from code

aObject inspect

Randomize a collection

aCollection shuffled.

Swapping two arrays

x become: y.

Get the ASCII value of a character

$A asciiValue

Converting a number between different bases

11 radix: 16

Interval objects

Say that you want a list of even numbers from 1 to 10
An easy way to do this sort of thing is through a Interval object.

x:=Interval from: 1 to: 10 by: 2.
aList:=x asOrderedCollection.

Getting the receiver

aObject yourself

Links to this Page