comparison extendlib.rhope @ 30:914ad38f9b59

Compiler now works for some simple programs
author Mike Pavone <pavone@retrodev.com>
date Mon, 28 Sep 2009 19:42:33 -0400
parents 8b2b3f4a2a58
children 6202b866d72c
comparison
equal deleted inserted replaced
29:3cc5e4a42344 30:914ad38f9b59
651 }{ 651 }{
652 out <- newlist 652 out <- newlist
653 } 653 }
654 } 654 }
655 655
656 656 _Collection =[col1,key1,col2,key2:out]
657 657 {
658 ,out <- If[[key1]=[key2]]
659 {
660 ,out <- If[[[col1]Index[key1]] = [[col2]Index[key2]]]
661 {
662 nkey1 <- [col1]Next[key1]
663 {
664 [col2]Next[key2]
665 {
666 out <- _Collection =[col1,nkey1,col2,~]
667 }{
668 out <- No
669 }
670 }{
671 [col2]Next[key2]
672 {
673 out <- No
674 }{
675 out <- Yes
676 }
677 }
678 }
679 }
680 }
681
682 Collection =[col1,col2:out]
683 {
684 first1 <- [col1]First
685 {
686 [col2]First
687 {
688 out <- _Collection =[col1, first1, col2, ~]
689 }{
690 out <- No
691 }
692 }{
693 [col2]First
694 {
695 out <- No
696 }{
697 out <- Yes
698 }
699 }
700 }
701
702 =@List[list1,list2:out]
703 {
704 ,out <- If[[[list1]Length >>] = [[list2]Length >>]]
705 {
706 out <- Collection =[list1,list2]
707 }
708 }
709
710 =@Dictionary[list1,list2:out]
711 {
712 ,out <- If[[[list1]Length >>] = [[list2]Length >>]]
713 {
714 out <- Collection =[list1,list2]
715 }
716 }