|
Pages: [1]
|
 |
|
Author
|
Topic: usefulness of 'also' (Read 492 times)
|
|
fhein
|
I was thinking, is the new function 'also' really useful? Can it do anything that a simple parenthesis can't?
Ie
a: also 1 print "a"
appears to do the same as
a: (print "a" 1)
Do you find the also-syntax more readable? Maybe if the additional stuff is really long, and you want the assigned value close to the set-word?
|
|
|
|
|
Logged
|
|
|
|
|
btiffin
|
Absolutely useful. It can save having to use temporary variables when traversing series (for one of many uses). d: first s s: next s d can now be also first s s: next s But 2.7.6 also includes first+ so that example is already 'out of date'. first+ s And looking at the source for also opens up all kinds of potential for selective evaluation. Need the first result of three? three: func [arg1 [any-type!] arg2 [any-type!] arg3 [any-type!]] [get/any 'arg1] Want the second of four just add an arg4 and get/any 'arg2. Cheers, Brian
|
|
|
|
|
Logged
|
|
|
|
|
Gabriele
|
The classic example is: also copy port close port
|
|
|
|
|
Logged
|
|
|
|
|
|
Pages: [1]
|
|
|
 |