[Top][All Lists]

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

Re: [Help-smalltalk] [RFC] Smalltalk scripting syntax

From: parasti
Subject: Re: [Help-smalltalk] [RFC] Smalltalk scripting syntax
Date: Wed, 14 Mar 2007 23:49:54 +0200
User-agent: Icedove (X11/20061220)

Paolo Bonzini wrote:
> The exclamation point is going to remain exactly for interactive
> sessions.  Remember that -- anyway -- what's badly needed is, as Mike
> pointed out earlier in this thread, nothing more than an easily parsable 
> syntax that denotes the *structure* of the program rather than how to
> reconstruct it.
> That's the main reason why I am suspicious of syntaxes that are
> pure Smalltalk.  It looks to me, though I might be wrong, that
> having "Object subclass: #MyClass!" is as bad as having
> "Object methodsFor: 'abc'!".  If somebody just adds a new method
> like
>     refine
>         "Define a subclass of self, with the same name, in the current
>          namespace."
>         self environment = Namespace current ifTrue: [ self halt ].
>         self subclass: self name!
> how can you expect things to be parsed correctly when one writes:
>     Set refine!
>     Set comment: 'not your ordinary set'!

Sorry, but you've got me confused.  What you've said above is the exact
opposite of what I understand by "scripting".  Scripting is an
interpreted dynamic on-the-fly kind of thing.  What I see above is a
static resolve-all-symbols-at-compile-time kind of thing, which
incidentally reminds me of a certain language.  I don't think there is
difference between "denoting structure" and "reconstruction" of a
program in a scripting environment.  In fact, I think there shouldn't
be.  I understand why there's a need for something better than
#methodsFor:, but the rest is just way out there, more useful for
compiler writers than language users.  Python's a scripting language:

    >>> f = lambda a, b: a + b + c
    >>> f(3, 4)
    Traceback (most recent call last):
      File "<stdin>", line 1, in ?
      File "<stdin>", line 1, in <lambda>
    NameError: global name 'c' is not defined
    >>> c = 5
    >>> f(3, 4)

Note how a reference to an undefined variable is an execution-time
exception.  That's the direction I'd like to see GNU Smalltalk heading.


reply via email to

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