help-smalltalk
[Top][All Lists]
Advanced

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

[Help-smalltalk] pragma inside a extend block


From: Derek Zhou
Subject: [Help-smalltalk] pragma inside a extend block
Date: Mon, 15 Apr 2019 11:09:24 +0800
User-agent: mu4e 0.9.18; emacs 25.1.1

Dear list:

If I write:

    SomeClass extend [
        <category: 'my extention'>

        method1 [
            ^self
        ]
        method2 [
            ^self
        ]
    ]

The category pragma is applied to the class, not the methods. Is there
even a reasonable usage model that need to _change_ the category of the
class? Also, if the block is a class extend [ ... ] a category pragma
inside will cause error.

To me, an extend block is just a grouping for methods, it probably makes
more sense to apply block level pragmas to all the methods within, as a
default value which can be overriden by local pragmas. This way at least
we can save some typing.  

Derek



reply via email to

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