Mailing List Archive: 49091 messages
  • Home
  • Script library
  • AltME Archive
  • Mailing list
  • Articles Index
  • Site search
 

[REBOL] Re: Limitation coming from the "initialize" refinement used with the "Ar

From: tomc::darkwing::uoregon::edu at: 27-Jun-2002 19:21

hi again for your second question an answer that will undoubtably be improved opon is:
>> unset [n1 n2 total diff] >> set['n1 'n2 'total 'diff] compose[15 25 (does [n1 + n2]) (does [n2 - n1])]
== [15 25 func [][n1 + n2] func [][n2 - n1]]
>> print [n1 n2 total diff]
15 25 40 10
>>
for the first part- though there are far better solutions than the one I offered I am not seeing a glitch. (REBOL/Core 2.5.0.3.1 on w98)
>> a: array/initial [3 2] 0
== [[0 0] [0 0] [0 0]]
>> r: 2 c: 1 d: 0
== 0
>> print a/:r/:c
0
>> do rejoin['a "/" r "/" c ": " 10]
== [10 0]
>> print a/:r/:c
10
>> a
== [[0 0] [10 0] [0 0]]
>> for i 1 3 1[for j 1 2 1[do rejoin['a "/" i "/" j ": " d: d + 10]]]
== [50 60]
>> a
== [[10 20] [30 40] [50 60]] On Thu, 27 Jun 2002, Gerard Cote wrote: