Definition:
block := [:a :b :c | a + b + c]. x := 1. y := 2. z := 3.
Auswertung:
block value: x value: y value: z --> 6
Aber:
block valueWithArguments: #(x y z) --> Fehlermeldung
Ist das beabsichtigt oder ein "Bug"?
Mit Dank für kompetente Ausdkunft
R. Baumann
-- View this message in context: http://forum.world.st/Frage-zu-block-valueWithArguments-in-Etoys-4-und-Squea... Sent from the Deutsch (German) mailing list archive at Nabble.com.
On Tue, 5 Jul 2011 15:11:53 -0700 (PDT) "R. Baumann" baumann-garbsen@t-online.de wrote:
block := [:a :b :c | a + b + c]. x := 1. y := 2. z := 3.
Auswertung:
block value: x value: y value: z --> 6
Aber:
block valueWithArguments: #(x y z) --> Fehlermeldung
Was ist der Unterschied zwischen #(x y z) und {x. y. z} ?
s.
Vielen Dank für den Hinweis: mit der Schreibweise {x. y. z} geht es sehr gut.
Gruß R. B.
-- View this message in context: http://forum.world.st/Frage-zu-block-valueWithArguments-in-Etoys-4-und-Squea... Sent from the Deutsch (German) mailing list archive at Nabble.com.
Hi - in the first case, x, y and z are variables and you are passing their values to the block.
In the second case, the values inside the array #(x y z) are the symbols #x, #y and #z. Try the following:
block valueWithArguments: (Array with: x with: y with: z)
or
block valueWithArguments: {x. y. z.}
The last case is not standard Smalltalk - it's a very convenient syntax sugar on top of Squeak.
Entschuldigung, aber ich habe fast alles mein Deutsch vergessen.
- Francisco
On Tue, Jul 5, 2011 at 11:11 PM, R. Baumann baumann-garbsen@t-online.dewrote:
Definition:
block := [:a :b :c | a + b + c]. x := 1. y := 2. z := 3.
Auswertung:
block value: x value: y value: z --> 6
Aber:
block valueWithArguments: #(x y z) --> Fehlermeldung
Ist das beabsichtigt oder ein "Bug"?
Mit Dank für kompetente Ausdkunft
R. Baumann
-- View this message in context: http://forum.world.st/Frage-zu-block-valueWithArguments-in-Etoys-4-und-Squea... Sent from the Deutsch (German) mailing list archive at Nabble.com.
Vielen Dank für den wertvollen Hinweis: "syntaktisch gezuckert" mit {x. y. z} geht es sehr gut.
Gruß R. B.
-- View this message in context: http://forum.world.st/Frage-zu-block-valueWithArguments-in-Etoys-4-und-Squea... Sent from the Deutsch (German) mailing list archive at Nabble.com.
squeak-ev@lists.squeakfoundation.org