comparison kernel.rhope @ 124:8aedae4f4ddd

Add support for Int32 as Dictionary key
author Mike Pavone <pavone@retrodev.com>
date Thu, 28 Oct 2010 21:05:50 -0400
parents f4fc0a98088a
children fc3815b7462f
comparison
equal deleted inserted replaced
123:4e4ecbca0b5d 124:8aedae4f4ddd
351 { 351 {
352 yep,nope <- If[[num]<[high]] 352 yep,nope <- If[[num]<[high]]
353 } 353 }
354 } 354 }
355 355
356 Dict Type ID@Int32[num:out]
357 {
358 out <- ID[Int32()]
359 }
360
361 Dict Bits@Int32[num,idx:out,invalid]
362 {
363 ,invalid <- If[[idx]<[4]]
364 {
365 out <- Abs UInt[[[num]RShift[[[3]-[idx]]LShift[3]]]&[255]]
366 }
367 }
368
369 From Dict Key@Int32[num,data:out]
370 {
371 out <- [[[[Int32[Trunc UInt16[[data]Index[0]]]]LShift[24]
372 ]|[[Int32[Trunc UInt16[[data]Index[1]]]]LShift[16]]
373 ]|[[Int32[Trunc UInt16[[data]Index[2]]]]LShift[8]]
374 ]|[Int32[Trunc UInt16[[data]Index[3]]]]
375 }
376