Self Objects
sanssecours
sanssecours at f-m.fm
Tue Nov 29 19:33:02 UTC 2005
Hello
I have to write a little paper about self. I haven't programmed
anything in Self or Smalltalk yet and only have a little experience in
the mainstream programming languages out there (C,Java..). I think I
already understand the "basics" of the Language. However there are
some code samples on the Self-Homepage that I don't understand for
example:
(| x. y |
x: 3.··y: 4.
x squared + y squared)
Ok as far as I know that sample shows an object with two slots that
contain the objects x and y but what do the rest of the code mean. It
seems like the code declares some method that returns x squared + y
squared but whats the name of this method how can you use this method
(in Java something like: Object.Method() - whats the corresponding
code in Self). And what do the Points: "··" between x: 3 and y: 4
mean. It woul be very nice if sombeody out ther could help me.
rene
More information about the Self-interest
mailing list