Hello,
I'm trying to use local variables in a block, that are writable and do not come from the parameter list. So something like this:
[| :arg1. | tmpVar: 5. arg1 + tmpVar. ] value: 1.
But I get told that "tmpVar: is not found"
Or does self not support such kind of local variables?
regards Chris
[| :arg1. tmpVar | tmpVar: 5. arg1 + tmpVar. ] value: 1.
Should work IIRC.
On Sep 18, 2018, at 3:54 PM, notebook notebook22312@gmail.com [self-interest] self-interest@yahoogroups.com wrote:
Hello,
I'm trying to use local variables in a block, that are writable and do not come from the parameter list. So something like this:
[| :arg1. | tmpVar: 5. arg1 + tmpVar. ] value: 1.
But I get told that "tmpVar: is not found"
Or does self not support such kind of local variables?
regards Chris
Perfect! Thank you!
On 2018年09月19日 08:39, David Ungar ungar@mac.com [self-interest] wrote:
[| :arg1. tmpVar | tmpVar: 5. arg1 + tmpVar. ] value: 1.
Should work IIRC.
On Sep 18, 2018, at 3:54 PM, notebook notebook22312@gmail.com mailto:notebook22312@gmail.com [self-interest] <self-interest@yahoogroups.com mailto:self-interest@yahoogroups.com> wrote:
Hello,
I'm trying to use local variables in a block, that are writable and do not come from the parameter list. So something like this:
[| :arg1. | tmpVar: 5. arg1 + tmpVar. ] value: 1.
But I get told that "tmpVar: is not found"
Or does self not support such kind of local variables?
regards Chris
Hello,
I'm currently going through the Handbook slowly to get myself ready to make some videos for self-starters. The question about local vars last time was also in this regard. Now I'm I'm stuck around chapter 3.2. I would (as always) really appreciate your help!
1. binary slots (§ 3.2.3)
I'm having trouble getting the example to work. This is probably due to the lack of my understanding. Example:
( | + = ( | :arg | (clone x: x + arg x) y: y + arg y ). | ) This will create a Slot object with a slot "+ arg (clone x: ..." I then create another slot object with a parent*-slot the the one I just created a parent2*-slot to traits clonable x-slot y-slot How would I call call + now? "self + self"? 2. Annotations / Grouping (§ 3.2.5) The handbook says, that the below creates a new slot containing a group "accessing" ( | { ’Category: accessing’ getOne = (...). getAnother = (...). } | )
That's working so far. But it creates a *new* object. What would I do, if I would like to *add* a group / annotation to an already existing object?
Best regards Chris
self-interest@lists.selflanguage.org