help-smalltalk
[Top][All Lists]
Advanced

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

Re: [Help-smalltalk] iliad and blocks


From: Paolo Bonzini
Subject: Re: [Help-smalltalk] iliad and blocks
Date: Mon, 22 Jun 2009 15:05:36 +0200
User-agent: Thunderbird 2.0.0.17 (X11/20081009)

Off list Nicolas suggested using #build: which is just a wrapper method calling #value:. With it, Joachim's #contents message would look like

contents [
        ^[ :e |
e build: self headerContent;
                add: menu build;
                break;
                build: self mainContent;
                build: self footerContents.
        ]
    ]


My reply is...

Even better for me would be:

Element >> build: aBuildable
        <category: 'building'>
        aBuildable buildOn: self

BlockClosure >> buildOn: anElement
        <category: 'building (Iliad)'>
        self value: anElement

Widget >> buildOn: anElement
        <category: 'building'>
        e add: self build

and then keeping the block structure for #contents, like

    contents [
        ^[ :e |
            e
                build: self headerContent;
                build: menu;
                break;
                build: self mainContent;
                build: self footerContents.
        ]
    ]

Paolo




reply via email to

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