mirror of
https://github.com/justinethier/cyclone.git
synced 2025-07-05 20:26:35 +02:00
Relocated pair->list
This commit is contained in:
parent
d322ccea65
commit
d0d889f594
2 changed files with 9 additions and 9 deletions
|
@ -71,7 +71,6 @@
|
|||
ast:lambda-formals-type
|
||||
ast:lambda-formals->list
|
||||
list->lambda-formals
|
||||
pair->list
|
||||
list->pair
|
||||
lambda->exp
|
||||
if->condition
|
||||
|
@ -395,14 +394,6 @@
|
|||
(car args)))
|
||||
(else (error `(Unexpected type ,type)))))
|
||||
|
||||
;; Create a proper copy of an improper list
|
||||
;; EG: (1 2 . 3) ==> (1 2 3)
|
||||
(define (pair->list p)
|
||||
(let loop ((lst p))
|
||||
(if (not (pair? lst))
|
||||
(cons lst '())
|
||||
(cons (car lst) (loop (cdr lst))))))
|
||||
|
||||
;; Create an improper copy of a proper list
|
||||
(define (list->pair l)
|
||||
(let loop ((lst l))
|
||||
|
|
|
@ -16,6 +16,7 @@
|
|||
if?
|
||||
begin?
|
||||
lambda?
|
||||
pair->list
|
||||
;; Environments
|
||||
env:enclosing-environment
|
||||
env:first-frame
|
||||
|
@ -66,6 +67,14 @@
|
|||
(define (lambda? exp)
|
||||
(tagged-list? 'lambda exp))
|
||||
|
||||
;; Create a proper copy of an improper list
|
||||
;; EG: (1 2 . 3) ==> (1 2 3)
|
||||
(define (pair->list p)
|
||||
(let loop ((lst p))
|
||||
(if (not (pair? lst))
|
||||
(cons lst '())
|
||||
(cons (car lst) (loop (cdr lst))))))
|
||||
|
||||
; char->natural : char -> natural
|
||||
(define (char->natural c)
|
||||
(let ((i (char->integer c)))
|
||||
|
|
Loading…
Add table
Reference in a new issue