help-smalltalk
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Help-smalltalk] GNU smalltalk command line interpreter


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] GNU smalltalk command line interpreter
Date: Tue, 26 Feb 2008 14:26:41 +0100
User-agent: Thunderbird 2.0.0.9 (Macintosh/20071031)

st> 'Hello, world' printNl
st>
But as one sees from that copy there happens absolutely nothing! That is
also true for "123456 printString",  "6 + 7"  and other trial inputs. If
this is not a line interpreter I argue that it is only possible to start
files with a "shebang" or “sharp-bang”?

Where is may error?

The tutorial only works for GNU Smalltalk 3.0.x; the usability of the command-line interpreter improved a lot in 3.0 in different ways:

1) each statement is evaluated separately and variables persist until you type a bang (exclamation mark). In 2.x each bang-separated chunk would be a single evaluation unit. If you want more statements to act as single evaluation units in 3.x, wrap them with "Eval [ ... ]"

2) periods are implied at the end of a line if the grammar allows that

3) temporary declarations are optional.

4) the output is actually printed using #printOn: and not by some crappy C code. :-)

Examples:

  #(1 2 3)!
  2.x => Array new: 3
  3.x => (1 2 3)

  a := 10 factorial
  b := a negated
  2.x => error (variables not declared, missing period before "b", etc.)
  3.x => 3628800 -3628800

I suggest that you download 3.0.1 and install it, or that you wait 10 days since on March 8th you could get the first release with support for Seaside. :-P

Paolo




reply via email to

[Prev in Thread] Current Thread [Next in Thread]