add procedure?

This commit is contained in:
Jan Nieuwenhuizen 2016-07-11 22:16:11 +02:00
parent ddccd4747a
commit 5d2259e55e
3 changed files with 16 additions and 2 deletions

5
TODO
View file

@ -32,6 +32,7 @@ v vector-length
v vector-ref
v vector-set!
v vector?
... possibly also: any, each, unquote-splicing, ...
** implement extras: (gensym)
v procedure?
** any, each, unquote-splicing, ...
** implement extras: v (gensym)
** hook-up sc-expand, see guile-1.0?: scheme:eval-transformer

View file

@ -24,6 +24,11 @@
(define (defined? x)
(assq x (current-module)))
(define (procedure? p)
(cond ((builtin? p) #t)
((pair? p) (eq? (car p) 'lambda))
(#t #f)))
(define (list . rest) rest)
(define (vector . rest) (list->vector rest))
(define assv assq)

View file

@ -260,4 +260,12 @@
(display ((lambda (x) x) (values 1 2 3)))
(newline)))
(display "(procedure? builtin?: ")
(display (procedure? builtin?))
(newline)
(display "(procedure? procedure?): ")
(display (procedure? procedure?))
(newline)
'()