Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

[cl-backend] added division

  • Loading branch information...
commit 345f4993e14d0f332f6a5fa9564be0b7312183b6 1 parent 77a9821
@pmurias pmurias authored
Showing with 13 additions and 2 deletions.
  1. +5 −1 cl-backend/backend.lisp
  2. +8 −1 simple-tests/arith.t
View
6 cl-backend/backend.lisp
@@ -36,7 +36,7 @@
;(nam-op ehspan (class name unused start end goto) )
;(nam-op span (n1 n2 sync body) body)
-(nam-op xspan (n1 n2 flag body dunno1 dunno2 dunno3) body)
+(nam-op xspan (n1 n2 flag body &rest rest) body)
(defun strip-ann (thing)
(if (consp thing)
@@ -258,6 +258,8 @@
(defun nam-null (type) nil)
+; HACK
+(nam-op bool (val) val)
; HACK
(nam-op corelex (var) `(nam-scopedlex ,var))
@@ -308,6 +310,8 @@
(defun nam-bif_mul (a b) (* (FETCH a) (FETCH b)))
+(defun nam-bif_divide (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)))
View
9 simple-tests/arith.t
@@ -1,4 +1,4 @@
-say "1..6";
+say "1..8";
if 1 == 2 {
say "not ok 1 # ==";
}
@@ -31,3 +31,10 @@ if 4 < 18 {
if 100 < 18 {
say "not ok 6 # >";
}
+
+if 18/3 == 6 {
+ say "ok 7 # /";
+}
+if 5/2 == 2.5 {
+ say "ok 8 # /";
+}
Please sign in to comment.
Something went wrong with that request. Please try again.