RE: [racket-users] Calling a procedure without allowing it to permanently alter parameters.

2016-01-13 Thread Jos Koot
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

Re: [racket-users] Calling a procedure without allowing it to permanently alter parameters.

2016-01-12 Thread Jon Zeppieri
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

Re: [racket-users] Calling a procedure without allowing it to permanently alter parameters.

2016-01-12 Thread jon stenerson
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

RE: [racket-users] Calling a procedure without allowing it to permanently alter parameters.

2016-01-12 Thread Jos Koot
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

Re: [racket-users] Calling a procedure without allowing it to permanently alter parameters.

2016-01-12 Thread jon stenerson
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

[racket-users] Calling a procedure without allowing it to permanently alter parameters.

2016-01-12 Thread Jos Koot
#| 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