Added (if-syntax?)

This commit is contained in:
Justin Ethier 2016-12-07 21:28:24 +00:00
parent 5179f2261b
commit 03f30ecf56

View file

@ -13,6 +13,7 @@
;; Code analysis ;; Code analysis
tagged-list? tagged-list?
if? if?
if-syntax?
begin? begin?
lambda? lambda?
pair->list pair->list
@ -90,6 +91,14 @@
(define (if? exp) (define (if? exp)
(tagged-list? 'if exp)) (tagged-list? 'if exp))
(define (if-syntax? exp)
(and
(if? exp)
(or
(= (length exp) 3)
(= (length exp) 4))))
; begin? : exp -> boolean ; begin? : exp -> boolean
(define (begin? exp) (define (begin? exp)
(tagged-list? 'begin exp)) (tagged-list? 'begin exp))