[ST-72] Bug when edit factorial

Jecel Assumpcao Jr jecel at merlintec.com
Tue Jun 10 01:34:16 UTC 2003


On Monday 09 June 2003 17:37, Stephane Ducasse wrote:
> Now I have some questions:
> 	- why the turtle has primitives and cannot simply be defined in
> ST-72

They could, but the performance would not be acceptable. Remember that 
as a Logo successor Turtle Graphics had to be a very usable part of the 
language.

>       - I thought that to was to create classes, but the fils AllDefs
> use it to for read, print.... I'm confused. I will have to reread the
> bootstrap

I'll quote the bottom of page 20 (p. 78 in the proceedings) of "The 
Early History of Smalltalk" by Alan Kay:

    One of the styles retained from Smalltalk-71 was the comingling of
    function and class ideas. In other works [should be words?],
    Smalltalk-72 classes looked like and could be used as functions, but
    it was easy to produce and instance (a kind of closure) by using the
    object ISNEW. Thus, factorial could be written "extensionally" as:

          to fact n (^if :n=0 then 1 else n*fact n-1)

    or "intensionally", as part of class integer:

          (.... %! ?(^:n=0 ?(1) (n-1)! )

    Of course, the whole idea of Smalltalk (and OOP in general) is to
    define everything intensionally. And this was the direction of
    movement as we learned how to program in the new style.

I imagine that "read" and "print" (and "to" itself) represent the early 
style.

-- Jecel



More information about the Squeak-dev mailing list