[racket] Delimiting scope

From: antoine (antoine.brand at sfr.fr)
Date: Sat Jan 18 11:11:11 EST 2014

Bonjour,

Is there a way to delimit scope?

example:
(let ([a 1])
  (delimit-scope
    (let ([b 1])
      (+ a b))))
Give an error of the form 'a: undefined;'

I use the include-template from web-server/templates in a way like:
(response/output
  (lambda (out)
    (display
      (include-template "my-template.html")
      out)))

"my-template.html" may also use include-template and i don't want an unexpected
bindings being used, i want to make bindings explicit.

I could use 
(let ([my-bindings....])  (include-template "my-template.html"))
but this isn't sufficient for prevent upper bindings from let form being used.


Another point totally different.

In racket there is a lot of functions like response/output that take a function
in parameter that take n-parameters.
Why not use a macro unhygienic that introduce those n-bindings but allow user to
rename the bindings names:
(response/output
  #:out-binding 'abc
  (display "something" abc))

(response/output
  (display "something" out))


Thank you.

Posted on the users mailing list.