Skip to content
Browse files

[cl-backend] added while

  • Loading branch information...
1 parent 1f02f87 commit c9e137b8219f4d829e50b52664b86ba5d093dfbd @pmurias pmurias committed
Showing with 15 additions and 0 deletions.
  1. +5 −0 cl-backend/backend.lisp
  2. +10 −0 simple-tests/while.p6
View
5 cl-backend/backend.lisp
@@ -270,9 +270,14 @@
(defun nam-bif_mul (a b) (* (FETCH a) (FETCH b)))
(defun nam-bif_numgt (a b) (> (FETCH a) (FETCH b)))
+(defun nam-bif_numlt (a b) (< (FETCH a) (FETCH b)))
(defun nam-bif_numeq (a b) (= (FETCH a) (FETCH b)))
+(nam-op whileloop (until once cond body) `(loop while ,cond do ,body))
+
+(defun nam-label (label))
+
(defun wrap-for-eval (compiled-unit)
`(let ((|&infix:<~>| #'p6-concat)
View
10 simple-tests/while.p6
@@ -0,0 +1,10 @@
+say "1..1";
+my $a = 0;
+my $b = 0;
+while $a < 12 {
+ $a = $a + 1;
+ $b = $b + 3;
+}
+if $b == 36 {
+ say "ok 1";
+}

0 comments on commit c9e137b

Please sign in to comment.
Something went wrong with that request. Please try again.