Jon and Jon,
Both thanks for your replies.
I'll stick to call-in-nested-thread.
Jos
_
From: Jon Zeppieri [mailto:zeppi...@gmail.com]
Sent: miƩrcoles, 13 de enero de 2016 6:03
To: Jos Koot
Cc: Racket Users
Subject: Re: [racket-users] Calling a procedure without allowing it to
perman
I don't think there is a better way than what you have.
I looked into the undocumented `reparameterize` procedure, from '#%paramz: [
https://github.com/racket/racket/blob/a6eb00a41cc29859424335f40ef9ae68c471c57a/racket/src/racket/src/thread.c#L7680],
but it only copies built-in parameters, so it fa
Calling a procedure without allowing it to
permanently alter parameters.
Can you use this instead?
(define (protected-caller thunk)
(parameterize ([p 'anything])
(thunk)))
Works for me
Jon
--
You received this message because you are subscribed to the Google Groups "Rack
s.com [mailto:racket-users@googlegroups.com]
On Behalf Of jon stenerson
Sent: miƩrcoles, 13 de enero de 2016 0:50
To: racket-users@googlegroups.com
Subject: Re: [racket-users] Calling a procedure without allowing it to
permanently alter parameters.
Can you use this instead?
(define (protected-caller
Can you use this instead?
(define (protected-caller thunk)
(parameterize ([p 'anything])
(thunk)))
Works for me
Jon
--
You received this message because you are subscribed to the Google Groups "Racket
Users" group.
To unsubscribe from this group and stop receiving emails from it, send a
#|
Hi,
Consider a procedure, say protected-caller,
that accepts a thunk and calls it,
but does not want any parameter or handler to be altered by the thunk.
Of course the called thunk can alter parameters and handlers for its own
use,
but I want all parameters and handlers reset after return from t
6 matches
Mail list logo