AW: how to define #compoundword

Alexander Lazarevic Alexander at Lazarevic.de
Thu Dec 11 09:23:53 UTC 2003


Hi Lulu!

Basically you can't do that, because the character . ends a statement in
Smalltalk like it ends a sentence in "normal" written text. This is
nothing peculiar to Smalltalk. You can't define a variable like below in
C because in that language the character ; works as the delimiter.

	int anti;christ

The closest you can get to what you are describing is to use the
construct 

	#'student.age'

But I think this is not what you want. I guess you are trying to convert
some C code to Smalltalk, right? So create a class Student with the
instance variable age and create accessor methods for it. With an
instance of that class you can set and get the age of that student
object. I'm a little verbose here, because if this is for a homework you
are doing you might want to have the fun to find out the details
yourself. :)

Alex (Squeak Newbie Warm Welcome Center. New SNW2C Tag proposed :)

-----Ursprüngliche Nachricht-----
Von: squeak-dev-bounces at lists.squeakfoundation.org
[mailto:squeak-dev-bounces at lists.squeakfoundation.org] Im Auftrag von ye
juan
Gesendet: Donnerstag, 11. Dezember 2003 08:33
An: squeak-dev at lists.squeakfoundation.org
Betreff: how to define #compoundword

Hi,
   How do I find the primitives for #word? that is,
what expression is defined as a word. I want to define
#compoundWord, like: "student.age", but Squeak divide
it into two words " student", "age". 
   Whoever knows this, please tell me as soon as
possible.
   Sincerely,
                     Lulu





More information about the Squeak-dev mailing list