/usr/lib/fluid-let-sr.scm is in scheme9 2013.11.26-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | ; Scheme 9 from Empty Space, Function Library
; By Nils M Holm, 2009
; Placed in the Public Domain
;
; (fluid-let ((variable expression) ...) expression ...) ==> object
;
; Bind variables dynamically, i.e. assign a dynamic (rather than
; a lexical/static) value to each given variable. The variables
; must be defined outside of FLUID-LET. The difference between
; LET and FLUID-LET is as follows:
;
; (let ((a 0)) (let ((a 0))
; (let ((f (lambda () a))) (let ((f (lambda () a)))
; (let ((a 1)) (fluid-let ((a 1))
; (f)))) ==> 0 (f)))) ==> 1
;
; Example: (let ((a 0))
; (let ((f (lambda () a)))
; (fluid-let ((a 1))
; (f)))) ==> 1
; This implementation is inefficient, use "fluid-let.scm" instead.
(load-from-library "syntax-rules.scm")
(define-syntax fluid-let
(syntax-rules ()
((_ () expr . exprs)
(begin expr . exprs))
((_ ((v1 a1) (v2 a2) ...) expr . exprs)
(let ((outer-v v1))
(set! v1 a1)
(fluid-let ((v2 a2) ...)
(let ((r (begin expr . exprs)))
(set! v1 outer-v)
r))))))
|