help-smalltalk
[Top][All Lists]
Advanced

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

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


From: Damien Pollet
Subject: Fwd: [Help-smalltalk] criticism of the new syntax
Date: Tue, 18 Dec 2007 12:27:46 +0100

I think I will never get used to lists that don't reply to themselves :)

---------- Forwarded message ----------
From: Damien Pollet <address@hidden>
Date: 17 Dec 2007 13:57
Subject: Re: [Help-smalltalk] criticism of the new syntax
To: address@hidden


On 17/12/2007, Paolo Bonzini <address@hidden> wrote:
> 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?

repeating person and using category: feels redundant... what about

Object subclass: Person [
    | name age |
    class @ 'one-shot category' >> nobody [ ^ NullPerson uniqueInstance ]
    class @ 'instance creation' [
        named: x birthdate: d [...]
        named: x [...]
    ]
    @ 'accessing' [
        name: aName
etc
--
Damien Pollet
type less, do more [ | ] http://typo.cdlm.fasmz.org


-- 
Damien Pollet
type less, do more [ | ] http://typo.cdlm.fasmz.org




reply via email to

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