pragma inside a extend block

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

pragma inside a extend block

Derek Zhou-3
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

_______________________________________________
help-smalltalk mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/help-smalltalk