Mercurial > repos > rhope
comparison extendlib.rhope @ 13:23dd9c766699
C backend close to being useable
author | mpavone@ |
---|---|
date | Tue, 26 May 2009 23:49:46 +0000 |
parents | b3f71490858c |
children | 90c20dc3f4e5 |
comparison
equal
deleted
inserted
replaced
12:31f8182f3433 | 13:23dd9c766699 |
---|---|
592 ,after <- [text]Slice[[prefix]Length] | 592 ,after <- [text]Slice[[prefix]Length] |
593 }{ | 593 }{ |
594 not found <- text | 594 not found <- text |
595 } | 595 } |
596 } | 596 } |
597 | |
598 Blueprint Range | |
599 { | |
600 Start | |
601 End | |
602 } | |
603 | |
604 Range[start,end:out] | |
605 { | |
606 out <- [[Build["Range"]]Start <<[start]]End <<[end] | |
607 } | |
608 | |
609 First@Range[range:out] | |
610 { | |
611 out <- [range]Start >> | |
612 } | |
613 | |
614 Next@Range[range,val:out,done] | |
615 { | |
616 next <- [val]+[1] | |
617 If[[next] < [[range]End >>]] | |
618 { | |
619 out <- Val[next] | |
620 }{ | |
621 done <- range | |
622 } | |
623 } | |
624 | |
625 Index@Range[range,index:out,notfound] | |
626 { | |
627 If[[index] < [[range]End >>]] | |
628 { | |
629 If[[index] < [[range]Start >>]] | |
630 { | |
631 notfound <- index | |
632 }{ | |
633 out <- index | |
634 } | |
635 }{ | |
636 notfound <- index | |
637 } | |
638 } | |
639 |