[Top][All Lists]

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

[Help-smalltalk] attributes within an extend block

From: Derek Zhou
Subject: [Help-smalltalk] attributes within an extend block
Date: Wed, 14 Aug 2019 05:16:45 +0800
User-agent: mu4e 0.9.18; emacs 25.1.1

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?


reply via email to

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