help-smalltalk
[Top][All Lists]
Advanced

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

Re: Simple Program Won't Run


From: address@hidden
Subject: Re: Simple Program Won't Run
Date: Sun, 17 Jan 2021 12:49:10 +0100 (CET)

I'm not sure that the Blue book has something like REPL
(Read-Eval-Print-Loop) and LOC (Lines of Code ?).

GNU smalltalk does a fine job of implementing some of the concepts of the 
interactive Smalltalk-80,
system, towards the world of line-oriented "REPL" read-eval-print-loop.

It also does this while retaining a good look-and-feel of the Smalltalk-80 
language,
but GNU smalltalk on the other hand is not as interactive as the other 
Smalltalk systems.

But Smalltalk-80 as a graphical "system" and interactive "system",
in the "interactive" system it is about "selecting" the statements that you 
want to evaluate.

For example you select statements in the "Workspace" and then the output can be 
in a "Transcript",
after you evaluate them by using the menu "Do it" or keyboard equivalent for 
"do-it".

As far as I can see in the "Blue book" (ST-80 Language and its Implementation),
it says:

"A method is made up of a message pattern and a sequence of expressions
separated by periods." (page 70)

But on page 73 it talks about the "interactive Smalltalk-80" system and writes,

"The programmer interactively selects all five lines - - the declaration
and the expressions - - and requests evaluation. "

And indeed on page 73 for interactively selected expressions: "The expressions 
are separated by periods, as in the syntax of a method."

Also for Blocks on page 53:
" A block represents a deferred sequence of actions.
A block expression consists of a sequence of expressions separated by
periods and delimited by square brackets. "


So basically GNU Smalltalk is following as well as possible those rules,
in the context of a line-oriented UNIX style read-eval-print-loop.

David Stes


----- Op 16 jan 2021 om 22:31 schreef bill-auger bill-auger@peers.community:

> it does conform to the spec though - the REPL syntax is exactly
> the same as a static file - the dot is not a statement
> terminator as with C-like languages - it is a statement
> separator, which means it is optional, where there is only one
> single statement - the same is true in a method definition - it
> is the reason why you rarely see a dot after the final LOC of a
> method definition - you will find that you can enter multiple
> statements on a single line in the REPL, just the same as you
> could in a static file; but they must be delimited by the
> separator char
> 
> st> 2 print . 3 print
> 22
> 33



reply via email to

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