add procedure?
This commit is contained in:
parent
ddccd4747a
commit
5d2259e55e
5
TODO
5
TODO
|
@ -32,6 +32,7 @@ v vector-length
|
||||||
v vector-ref
|
v vector-ref
|
||||||
v vector-set!
|
v vector-set!
|
||||||
v vector?
|
v vector?
|
||||||
... possibly also: any, each, unquote-splicing, ...
|
v procedure?
|
||||||
** implement extras: (gensym)
|
** any, each, unquote-splicing, ...
|
||||||
|
** implement extras: v (gensym)
|
||||||
** hook-up sc-expand, see guile-1.0?: scheme:eval-transformer
|
** hook-up sc-expand, see guile-1.0?: scheme:eval-transformer
|
||||||
|
|
5
scm.mes
5
scm.mes
|
@ -24,6 +24,11 @@
|
||||||
(define (defined? x)
|
(define (defined? x)
|
||||||
(assq x (current-module)))
|
(assq x (current-module)))
|
||||||
|
|
||||||
|
(define (procedure? p)
|
||||||
|
(cond ((builtin? p) #t)
|
||||||
|
((pair? p) (eq? (car p) 'lambda))
|
||||||
|
(#t #f)))
|
||||||
|
|
||||||
(define (list . rest) rest)
|
(define (list . rest) rest)
|
||||||
(define (vector . rest) (list->vector rest))
|
(define (vector . rest) (list->vector rest))
|
||||||
(define assv assq)
|
(define assv assq)
|
||||||
|
|
8
test.mes
8
test.mes
|
@ -260,4 +260,12 @@
|
||||||
(display ((lambda (x) x) (values 1 2 3)))
|
(display ((lambda (x) x) (values 1 2 3)))
|
||||||
(newline)))
|
(newline)))
|
||||||
|
|
||||||
|
(display "(procedure? builtin?: ")
|
||||||
|
(display (procedure? builtin?))
|
||||||
|
(newline)
|
||||||
|
|
||||||
|
(display "(procedure? procedure?): ")
|
||||||
|
(display (procedure? procedure?))
|
||||||
|
(newline)
|
||||||
|
|
||||||
'()
|
'()
|
||||||
|
|
Loading…
Reference in a new issue