on-key
(W10; keys wo angle brackets are returned as words):key num char
-----------------------
<back> 8 #"^H"
<tab> 9 #"^-"
<ctrl-enter> 10 #"^/"
<enter> 13 #"^M"
<esc> 27 #"^["
caps-lock 20 #"^T"
page-up 33 #"!"
page-down 34 #"^""
end 35 #"#"
home 36 #"$"
left 37 #"%"
up 38 #"&"
right 39 #"'"
down 40 #"("
insert 45 #"-"
delete 46 #"."
F1 112 #"p"
F2 113 #"q"
F3 114 #"r"
F4 115 #"s"
F5 116 #"t"
F6 117 #"u"
F7 118 #"v"
F8 119 #"w"
F9 120 #"x"
>> make image! [1x1 255.210.0.120]
== make image! [1x1 #{FFD200} #{
78}]
>> make image! [1x1 255.210.0 #{78}]
== make image! [1x1 #{FFD200}]
>> make image! [1x1 #{FFD200} #{78}]
== make image! [1x1 #{FFD200} #{
78}]
>> length? b
== 8
Seems to map to 01010100, but 42 is 00101010.
I'm missing something, and need to learn me some more stuff.
"""
Ren-C is a diverging hostile fork of Rebol3 (not supported nor endorsed by Rebol3's creator). It has no relation with Red, nor is there any chance that any kind of "merge" will ever occur with it. The SO room named "Rebol and Red" is misleading, as it's mainly dedicated to that fork. It is not a place where Red contributors and community meet.
– DocKimbel Oct 2 '16 at 14:45
"""
@gltewalt Yes that seems to be a problem:
>> c: to-binary 1
== #{00000001}
>> c: to-bitset c
== make bitset! #{00000001}
>> repeat i length? c [prin pick [1 0] c/:i]
00000000000000000000000000000010
>> to-integer 2#{00000000000000000000000000000010}
== 2
Also:
>> c: to-binary "a"
== #{61}
>> c: to-bitset c
== make bitset! #{61}
>> repeat i length? c [prin pick [1 0] c/:i]
11000010
>> to-char 2#{11000010}
*** Access Error: invalid UTF-8 encoding: #{C2000000}
*** Where: to
*** Stack: to-char
>> to-char 2#{01100001}
== #"a"
But:
;...
>> c: to-integer 2#{11000010}
== 194
>> c: shift c 1
== 97
>> to-char c
== #"a"
>> 84 >> 1
== 42
>> shift/left 42 1
== 84
to
conversion did that for us