(define cwd (make-parameter "/home"))
(define (foo x)
(displayln (cwd))
(displayln x))
(define-syntax-rule (bar d body)
(parameterize [(cwd (string-append (cwd) "/" d))]
(begin body)))
(foo 12)
(bar "myuser"
(begin
(foo 12)
(bar "another_dir"
(foo 14))))
CihkZWZpbmUgY3dkIChtYWtlLXBhcmFtZXRlciAiL2hvbWUiKSkKCihkZWZpbmUgKGZvbyB4KQoJKGRpc3BsYXlsbiAoY3dkKSkKCShkaXNwbGF5bG4geCkpCgkKKGRlZmluZS1zeW50YXgtcnVsZSAoYmFyIGQgYm9keSkKCShwYXJhbWV0ZXJpemUgWyhjd2QgKHN0cmluZy1hcHBlbmQgKGN3ZCkgIi8iIGQpKV0KCQkoYmVnaW4gYm9keSkpKQoJCgkKKGZvbyAxMikKKGJhciAibXl1c2VyIgoJKGJlZ2luCiAgIChmb28gMTIpCgkgIChiYXIgImFub3RoZXJfZGlyIgoJCSAgKGZvbyAxNCkpKSk=