[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-smalltalk] criticism of the new syntax
From: |
Derek Zhou |
Subject: |
Re: [Help-smalltalk] criticism of the new syntax |
Date: |
Mon, 17 Dec 2007 23:13:12 -0800 |
User-agent: |
KMail/1.9.7 |
On Monday 17 December 2007 01:01:10 am Paolo Bonzini wrote:
> 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.
> Yes, that's nice. Unfortunately, I thought of it as well as of permitting
>
> 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 :)
>
> at toplevel, but they would not be easy to implement in the current
> parser. However, based on you proposal, something I could do pretty
> easily is this:
>
> Object subclass: Person [
>
> | name age |
>
> Person class >> category: 'instance creation' [
> new [
> ...
> ]
> ...
> ]
> ]
>
> What do you think?
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.
>
> Paolo
Derek