[self-interest] Re: data structures

Ian Trudel ian at monk.cgocable.ca
Wed Jun 9 04:49:41 UTC 1999


: -----Original Message-----
: From: root at srv4-sao.sao.nutecnet.com.br
: [mailto:root at srv4-sao.sao.nutecnet.com.br]On Behalf Of Jecel Assumpcao
: Jr
: Sent: 8 juin, 1999 15:08
: To: Jose' B. Garcia Perez-Schofield
: Cc: self-interest at egroups.com
: Subject: [self-interest] Re: data structures
:
:
: Jose' B. Garcia Perez-Schofield wrote:
: >         (|parent* = traits oddball. contents *= vector |)
: >
: >         And that's the problem: I simply can't do this because I don't
: > know how to do it.  :-(
: >         I couldn't find information about it into the Self 4.0
: > Programmer's Reference (probably it is my fault).
:
: Actually, the solution isn't at all obvious unless you really
: think about it:
:
:      (| parent* = traits oddball.
:         contents = vector copySize: 3 FillingWith: 0
:      |)
:
: In Smalltalk we would do "vector new: 3" since everything is
: initialized with nil, but Self doesn't like defaults and so you
: have to choose some initial value (like 0 in this example)
: explicitly.


Out of interest, why Self doesn't like defaults? Time consuming? Personnaly,
I prefer everything has a default value before uses. Maybe just because I
am, and every programmer I know, are human and sometimes forgot to
initialize.

Ian


------------------------------------------------------------------------

eGroups.com home: http://www.egroups.com/group/self-interest
http://www.egroups.com - Simplifying group communications






More information about the Self-interest mailing list