On Tue, 31 Jul 2012, Jeronimo Pellegrini wrote:
[...] 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?). [...]
Hello, this is really strange! Since the second lambda expression is in tail position with respect to the first, the two continuations x and y are actually equivalent, so at first I was less surprised by their printed representation than by the results of the equality predicates. But then I tried to wrap some other function call around the inner invocation of call-with-current-continuation -- and the two continuation procedures still had the same printed representation. I guess one just cannot rely on intuition in this case ;-) Ciao, Thomas -- When C++ is your hammer, every problem looks like your thumb.
smime.p7s
Description: S/MIME Cryptographic Signature
_______________________________________________ Chicken-users mailing list Chicken-users@nongnu.org https://lists.nongnu.org/mailman/listinfo/chicken-users