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

[REBOL] Re: issue-to-tuple

From: oliva:david:seznam:cz at: 22-Apr-2002 10:34

Hello all,
>>How about >> >> to-tuple form issue >> >>Anton.
X> If I understand it well Oldes needs that function for converting hexa X> RGB values to REBOL format so this won't work. X> I vote for [to-tuple debase/base clr 16] :) Yes, you are right Bolek, I need it for converting hexa RGB values in my Rebol/Flash dialect (my first reason why to use issue datatype ever:). I've reduced the problem just just for converting issue to binary (because there is no problem to convert binary to proper tuple) and did some quick test: REBOL/VIEW
>> to-binary #234311
== #{323334333131}
>> issue-to-binary: func[clr ][load head insert tail insert next mold clr "{" "}"] >> issue-to-binary #234311
== #{234311}
>> t1: now/precise loop 1000000 [issue-to-binary #234311] t2: now/precise t2/time - t1/time
== 0:00:07.08
>> issue-to-binary: func[clr ][load head insert tail insert head form clr "#{" "}"] >> t1: now/precise loop 1000000 [issue-to-binary #234311] t2: now/precise t2/time - t1/time
== 0:00:07.32
>> issue-to-binary: func[clr ][load rejoin ["#{" form clr "}"]] >> t1: now/precise loop 1000000 [issue-to-binary #234311] t2: now/precise t2/time - t1/time
== 0:00:16.604
>> ;with the Brett's debase patch >> t1: now/precise loop 1000000 [issue-to-binary #234311] t2: now/precise t2/time - t1/time
== 0:00:26.608
>> ;without the patch -> CRASH
So although my solution looks like more complicated, it's much more faster. The problem is in the DEBASE - Debase is native but with a bug inside so it's useless:-( cheers Oldes PS: latest Rebol/Flash example: http://oldes.multimedia.cz/swf/swf5-clock2.html