mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-12 23:37:38 +02:00
Added (if-syntax?)
This commit is contained in:
parent
5179f2261b
commit
03f30ecf56
1 changed files with 9 additions and 0 deletions
|
@ -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))
|
||||||
|
|
Loading…
Add table
Reference in a new issue