[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Chicken-users] Printing procedures returned from call/cc
From: |
Jeronimo Pellegrini |
Subject: |
[Chicken-users] Printing procedures returned from call/cc |
Date: |
Tue, 31 Jul 2012 09:59:44 -0300 |
User-agent: |
SquirrelMail/1.4.21 |
Hello,
I was wondering why this happens in Chicken (recent checkout from git):
(let ((lst (call/cc (lambda (x)
(print 'something)
(call/cc (lambda (y)
(list x y)))))))
(print lst)
(print (eq? (car lst) (cadr lst)))
(print (eqv? (car lst) (cadr lst)))
==>
(#<procedure (f_10734 . results1838)> #<procedure (f_10734 . results1838)>)
#f
#f
The procedures returned are different continuations (and of course
they are certainly not eq? or eqv?). So I was wondering, then, why print
(and write, etc) show the same names for them. I mean, they were printed
from the same list, so in the same lexical context, and they are
different... It's a bit confusing that they "look the same" when
printed -- they wouldn't look the same if their names were something
"generic" like "#<continuation>", but they actually have names that look
like something generated by gensym. I'm probably missing something, but
can't see exactly what.
Thanks!
J.
- [Chicken-users] Printing procedures returned from call/cc,
Jeronimo Pellegrini <=