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

[REBOL] Re: code beauty... fiction ?

From: g:santilli:tiscalinet:it at: 11-Oct-2001 11:18

Hallvard Ystad wrote:
> I don't find this a very sexy way to do it. Has anyone got any suggestions to do it in a more intuitive way? >> byte: make struct! [value [char]] [#"^(00)"] >> byte/value: #"A"
== #"A"
>> third byte
== #{41}
>> short: make struct! [value [short]] [0] >> short/value: 15342
== 15342
>> third short
== #{EE3B} WARNING: machine dependend. As you can see, endianess counts. This can be used to convert the other way around:
>> change third short #{FF0A}
== #{}
>> short/value
== 2815 This works on /View even without /Pro key. Regards, Gabriele. -- Gabriele Santilli <[giesse--writeme--com]> - Amigan - REBOL programmer Amiga Group Italia sez. L'Aquila -- http://www.amyresource.it/AGI/