# HG changeset patch # User Mike Pavone # Date 1288314350 14400 # Node ID 8aedae4f4ddd0d2672bc1c4207929c1e8167ed1a # Parent 4e4ecbca0b5dce407f1121831225082b8876b320 Add support for Int32 as Dictionary key diff -r 4e4ecbca0b5d -r 8aedae4f4ddd kernel.rhope --- a/kernel.rhope Thu Oct 28 21:05:24 2010 -0400 +++ b/kernel.rhope Thu Oct 28 21:05:50 2010 -0400 @@ -353,3 +353,24 @@ } } +Dict Type ID@Int32[num:out] +{ + out <- ID[Int32()] +} + +Dict Bits@Int32[num,idx:out,invalid] +{ + ,invalid <- If[[idx]<[4]] + { + out <- Abs UInt[[[num]RShift[[[3]-[idx]]LShift[3]]]&[255]] + } +} + +From Dict Key@Int32[num,data:out] +{ + out <- [[[[Int32[Trunc UInt16[[data]Index[0]]]]LShift[24] + ]|[[Int32[Trunc UInt16[[data]Index[1]]]]LShift[16]] + ]|[[Int32[Trunc UInt16[[data]Index[2]]]]LShift[8]] + ]|[Int32[Trunc UInt16[[data]Index[3]]]] +} +