dynamic pairs
[1/6] from: peter:bjoerk:sda:ch at: 9-Nov-2009 13:54
Hi!
I'd like to use variables in a make statement for creating pairs:
a: 1
b: 2
p: make pair! [a b] does not work for me.
tia
Peter Björk
Schweizerische Depeschenagentur Ag
Längassstrasse 7
CH-3012 Berne
Tel-M: +41-31-775 9892
Tel-G: +41-31-309 3986
E-Mail: bj-sda.ch
[2/6] from: semseddinm:bircom at: 9-Nov-2009 15:00
p: make pair! as-pair a b
should work.
[3/6] from: peter:bjoerk:sda:ch at: 9-Nov-2009 14:07
That did it.
Thanks!
Peter Björk
Schweizerische Depeschenagentur Ag
Längassstrasse 7
CH-3012 Berne
Tel-M: +41-31-775 9892
Tel-G: +41-31-309 3986
E-Mail: bj-sda.ch
Semseddin Moldibi [ Bircom ]
<semseddinm-bircom.com>
Gesendet von: rebol-bounce-rebol.com
11/09/2009 01:58 PM
Bitte antworten an
rebolist-rebol.com
An
<rebolist-rebol.com>
Kopie
Thema
[REBOL] Re: dynamic pairs
p: make pair! as-pair a b
should work.
[4/6] from: sqlab:gmx at: 9-Nov-2009 14:37
>> p: as-pair a b
== 1x2
is enough or
>> p: to-pair reduce [a b]
== 1x2
On 09.11.2009 14:00, Semseddin Moldibi [ Bircom ] wrote:
[5/6] from: moliad:g:mail at: 11-Nov-2009 5:55
and the fastest method is:
p: (1x0 * a) + (0x1 * b)
-MAx
2009/11/9 sqlab <sqlab-gmx.net>:
[6/6] from: semseddinm:bircom at: 11-Nov-2009 13:36
Yes it is faster than the other methods:
>> a: 2 b: 3 d: now/precise loop 500000 [t: (1x0 * a) + (0x1 * b)]
difference now/precise d
== 0:00:00.187
>> a: 2 b: 3 d: now/precise loop 500000 [t: as-pair a b] difference
now/precise d
== 0:00:00.281