help-smalltalk
[Top][All Lists]
Advanced

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

Re: [Help-smalltalk] criticism of the new syntax


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] criticism of the new syntax
Date: Tue, 18 Dec 2007 09:15:24 +0100
User-agent: Thunderbird 2.0.0.9 (Macintosh/20071031)

Also, most languages (Java, Python, Ruby) are doing
whole-class-as-a-block, and the main objective of the new syntax was to
make the language reasonable to people familiar with those languages.

I agree; but I still think we should not _enforce_ whole-class-as-a-block like java does. It would seriously limit the freedom in organizing source code.

We do not enforce it; loose methods are permitted of course. Loose methods however do not have one level less of indentation.

Person >> new [
     <category: '...'>
]

So loose methods like this are permitted? Come to think of it, there must be a way to define additional methods outside the main class definition block; otherwise one of the main strength (being able to add methods without subclassing) of smalltalk just disappears :)

Loose methods are done with "CLASS extend [ ... ]" or "CLASS class extend [ ... ]". The syntax I hinted that above was thought of, but as I said it would be hard to implement it in the current parser. Maybe for 3.1.

But this is still whole-class-as-a-block, and it even add another layer of indention. What I really want is being able to break up a large class into multiple files, each one defining one of more categories.

You can do that, even though each will be "very indented" :-P

But in the first place, why do you want large classes? :-)

Paolo




reply via email to

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