if i run in repl following code:
(define (t1 f)
(f '(123))
1)
(define (tt)
(lambda (a)
(let* ((data (box '()))
(v (t1 (lambda (d)
(set-box! data d)))))
(cons (unbox data) v))))
(define tf (tt))
and then call (tf 1) i got '((123) . 1) as expected.
but if i put t1 and tt in foobar.scm:
#lang racket
(provide tt)
(define (t1 f)
(f '(123))
1)
(define (tt)
(lambda (a)
(let* ((data (box '()))
(v (t1 (lambda (d)
(set-box! data d)))))
(cons (unbox data) v))))
and then run in repl:
(require "foobar.scm")
(define tf (tt))
and call (tf 1) - i got '(() . 1)
and if i change return value in tt to (cons v (unbox data)) - result will
be correct again.
also if i just put (printf "hello~n") before (cons ..) in tt - result will
be correct also.
so i guess in some case (unbox data) sowehow calculated before computating
value of v.
p.s. sorry for my poor english.
--
You received this message because you are subscribed to the Google Groups
"Racket Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/racket-dev/ff3a8778-98db-45c7-b870-bd8f43422b02%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.