Przeglądaj źródła

Implement null? predicate

Lucas Stadler 8 lat temu
rodzic
commit
9373479351
1 zmienionych plików z 5 dodań i 1 usunięć
  1. 5 1
      scm/inc/compiler.scm

+ 5 - 1
scm/inc/compiler.scm

@ -59,6 +59,10 @@
59 59
        (emit-expr (primcall-operand1 x))
60 60
        (emit "cmpl $0,  %eax") ; x == 0
61 61
        (emit-compare))
62
       ((null?)
63
        (emit-expr (primcall-operand1 x))
64
        (emit "cmpl $~a, %eax" #b00101111)
65
        (emit-compare))
62 66
       ((integer?)
63 67
        (emit-expr (primcall-operand1 x))
64 68
        (emit "andl $~a, %eax" #b11)
@ -77,4 +81,4 @@
77 81
  (emit-expr x)
78 82
  (emit "ret"))
79 83
80
(compile-program '(boolean? #f))
84
(compile-program '(null? ()))