[REBOL] Re: Compose iterated fields with different names for each
From: jason:cunliffe:verizon at: 11-Jan-2002 23:42
Brett Handley
<[brett--codeconscious--com]> wrote:
...snip..
> I did not realise before now just how powerful this extending feature is.
It
> could be used to help build more sophisticated frameworks or reduce the
> complexity of your code.
>
> For example, when you create styles you can base one style upon another in
> order to share common features. But what if you are using someone else's
> styles? Here is a contrived example. Instead of writing:
>
> view layout [
> box "click me" red [
> print ["box has been activated"]
> ]
> button "click me" [
> print ["button has been activated"]
> ]
> ]
>
> we can use common code:
>
> a-common-action: [
> action: func[face value][print [face/style "has been activated"]]
> ]
> view layout [
> box "click me" red with a-common-action
> button "click me" with a-common-action
Brett,
Thank you. This is really an interesting discovery and very rebolistic..
As you say, it could really open the door to powerful but readable
frameworks.
./Jason