multicasting (was: idea: slices)
rainer at physik3.gwdg.de
Sat Jun 15 10:31:12 UTC 1996
Jecel pointed out (offline) that
> You could write
> selection do: [ | :element. :distance. :speed |
> element moveBy: distance With: speed.
> ] With: distance With: speed
which is far less ugly than my code. With optional arguments, this
wouldn't even require multiple methods, as long as one is content
with a maximum number of arguments.
Making the element argument a parent would yield what I tried in
the first place. If it weren't that, to my surprise, blocks cannot
have parent slots.
[ | :element. | element ifTrue: 'OK' False: 'Huh?' ] value: true
[ | :element*. | ifTrue: 'OK' False: 'Huh?' ] value: true
=> Syntax error.
[ | :element. environment*. | environment: element.
ifTrue: 'OK' False: 'Huh?' ] value: true
=> Lookup error: ifTrue not found.
More information about the Self-interest