help-smalltalk
[Top][All Lists]
Advanced

[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: Tue, 13 Mar 2007 22:11:12 +0200
User-agent: Icedove 1.5.0.9 (X11/20061220)

Paolo Bonzini wrote:
>>     Object subclass: #MyClass.
>>     MyClass comment: 'A simple example class'.
> 
> Except that MyClass is not available yet...
> 
> One would need something like
> 
>         Object subclass: #MyClass!
>         MyClass comment: 'A simple example class'!
> 
> or
> 
>     Eval [
>         Object subclass: #MyClass.
>     ]
>     Eval [
>         MyClass comment: 'A simple example class'.
>     ]

Given the alternative I'd keep the exclamation point.  I can't imagine
what would an interactive session look like.  I'm over my head here,
though.  Come to think of it, Eval [] heavily reminds me of an ordinary
function call.

>>   * Class and instance variables are defined the same way, except that
>> class variables are defined within class method definition scope and
>> instance variables -- within instance method definition scope.
> 
> Unfortunately, the | | syntax for instance variables will define
> *class-instance* variables when used in class method definition scope.
> 
> This was probably something you and Mike both missed.

Oh, you're right.  I left class instance variables out of the picture.
This is getting a bit confusing now...  I was trying to figure out a way
without hijacking the temporary variable declaration.  I do think that
it's better when all of the variables are explicitly declared instead of
having their definitions being scattered all over the method definition
scope.  (Or scopes!)  Well, class variables wouldn't, anyway.  But I'd
rather choose that than using the temporary variable declaration
literal.  I've gotten used to the idea that they're "temporary" and
conceptually only exist during execution of something.  A lifetime of an
object seems far too different to be called "execution" of the object.

>> Something that I didn't notice in the examples was pool dictionaries.  I
>> can't say I've seen any examples of how they're actually used in
>> practice but since they have to be declared in the usual class
>> definition, they're probably used for something.  Will there be syntax
>> to handle them?
> 
> Yes, it should be something like
> 
>     <import: PoolDictionary>

Heh.  I guess that was simple one.  :-P

Jānis





reply via email to

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