[net.lang.st80] ambiguous grammar

budd@arizona.UUCP (01/21/84)

on the ambiguous grammar -

no, you miss my point.  Look, for example, at page 79 in the Goldberg book:

   (incomes includesKey: source)
        ifTrue: [...]
        ifFalse: [ ^ 0]

   totalSpentFor: reason

now, the totalSpentFor is the start of the NEXT method.  However, looking
at the printed source, and attempting to parse it, there is no way that
one can tell this from the possibility that totalSpentFor is part of the
command being sent to (incomes ...).

The answer seems to be that the Smalltalk system does NOT look at the source
as it is displayed, but rather keeps it internally in a different form, and
edits, etc are performed at the method level, not at the entire class
description level. nmk@brown has pointed this out to me by mail, but
subsequent messages on the net seem to have missed the point.

shprentz@proper.UUCP (Joel Shprentz) (01/26/84)

Smalltalk does not store source code in the publication
format used by the three books from Addison-Wesley.
Source code is stored on file with delimiters separating methods.

Details can be found in chapter 3, The Smalltalk-80 Code File Format,
in Glen Krasner's book, Smalltalk-80, Bits of History, Words of Advise.