extensions

Accessing Succinctly

Tagged:  •  

There are times when you have code that looks like this:


Object subclass: MyNewClass [
    | foo bar baz traz bif |

    foo     [ ^ foo ]
    bar     [ ^ bar ]
    baz     [ ^ baz ]
    traz    [ ^ traz ]
    bif     [ ^ bif ]

    foo: aFoo   [ foo := aFoo ]
    traz: aTraz [ traz := aTraz ]
    baz: aBaz   [ baz := aBaz ]

    myMethod [
        "Do something with all of those instance variables"
    ]
]

Syndicate content

User login