Mercurial > repos > rhope
comparison kernel.rhope @ 75:0083b2f7b3c7
Partially working implementation of List. Modified build scripts to allow use of other compilers. Fixed some bugs involving method implementations on different types returning different numbers of outputs. Added Fold to the 'builtins' in the comipler.
author | Mike Pavone <pavone@retrodev.com> |
---|---|
date | Tue, 06 Jul 2010 07:52:59 -0400 |
parents | a844c623c7df |
children | 4d5ea487f810 |
comparison
equal
deleted
inserted
replaced
74:a844c623c7df | 75:0083b2f7b3c7 |
---|---|
1 Import string.rhope | |
2 Import list.rhope | |
3 Import functional.rhope | |
1 | 4 |
2 Val[in:out] | 5 Val[in:out] |
3 { | 6 { |
4 out <- in | 7 out <- in |
5 } | 8 } |
343 ]Set[index,val] | 346 ]Set[index,val] |
344 } | 347 } |
345 } | 348 } |
346 } | 349 } |
347 | 350 |
351 Length@Array[arr:out] | |
352 { | |
353 out <- [arr]Length >> | |
354 } | |
355 | |
348 Call@Array[arr(Array),index(Int32):out] | 356 Call@Array[arr(Array),index(Int32):out] |
349 { | 357 { |
350 out <- [arr]Index[index] | 358 out <- [arr]Index[index] |
351 } | 359 } |
352 | 360 |
353 | 361 And[left,right:out] |
362 { | |
363 ,out <- If[left] | |
364 { | |
365 out,out <- If[right] | |
366 } | |
367 } | |
368 | |
369 Or[left,right:out] | |
370 { | |
371 out <- If[left] {} | |
372 { | |
373 out <- right | |
374 } | |
375 } | |
376 | |
377 | |
378 |