variable: display: WIP

This commit is contained in:
Jan Nieuwenhuizen 2019-11-16 23:02:33 +01:00 committed by Jan (janneke) Nieuwenhuizen
parent f7ffa7cfeb
commit 4f70be1c32
No known key found for this signature in database
GPG Key ID: F3C1A0D9C1D65273
2 changed files with 5 additions and 2 deletions

View File

@ -125,7 +125,10 @@
(display ">" port)) (display ">" port))
((variable? x) ((variable? x)
(display "#<variable " port) (display "#<variable " port)
(write (list->string (car (core:car x))) port) (if (pair? (core:car x)) (display (car (core:car x)) port)
(begin
(display "value: " port)
(display (core:car x) port)))
(display ">" port)) (display ">" port))
((number? x) ((number? x)
(display (number->string x) port)) (display (number->string x) port))

View File

@ -39,7 +39,7 @@ struct scm *
car_ (struct scm *x) car_ (struct scm *x)
{ {
struct scm *a = x->car; struct scm *a = x->car;
if (x->type == TPAIR) if (x->type == TPAIR || x->type == TCLOSURE || x->type == TVARIABLE)
return a; return a;
return make_number (cast_scmp_to_long (a)); return make_number (cast_scmp_to_long (a));
} }