attributes within an extend block

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

attributes within an extend block

Derek Zhou-3
Dear list,

I think I proposed this before, but could not find the email. Currently
in an extend block, attributes are applied to the class. for example:

Object extend [
<category: 'my additions'>

    method1 [
    method2 [

The above code will change the category of the class Object. In a:

Object class extend [
<category: 'my additions'>

    method1 [

The above code will not compile, because you cannot change attributes
of a meta class. What I am proposing is to change the behaviour of
attributes within an extend block so they apply to individual methods in
the extend block. Why do you want to change attributes for the already
defined class? However, it makes a lot of sense to group methods into
blocks and write just one <category: '...'> statement instead of one
for each method, this way a lot of typing is saved.

Today I finally got a patch working. With this patch, attributes within
the extend block will apply to all methods within the extend block, and
each method can still provide additional or overriding attributes in the
old way. Any comment?


help-smalltalk mailing list
[hidden email]