core: Fix printing bindings.

* src/lib.c (car_): Support taking the car of a binding.
* mes/module/mes/display.mes (display): Do not use 'list->string'
when displaying a binding.
This commit is contained in:
Timothy Sample 2022-04-12 13:53:48 -06:00
parent 91b1c6e233
commit 895eaa4c5e
2 changed files with 2 additions and 2 deletions

View File

@ -125,7 +125,7 @@
(display ">" port))
((binding? x)
(display "#<binding " port)
(write (list->string (car (core:car x))) port)
(write (car (core:car x)) port)
(display ">" port))
((number? x)
(display (number->string x) port))

View File

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