[Remove unused functions clinton@unknownlamer.org**20100329212100 Ignore-this: f3de2a2b6fe1e8098588f2a09e65852e ] hunk ./module/scsh/syntax-helpers.scm 22 -;;; name? -> identifier? -;; (define (name? thing) -;; (or (symbol? thing) -;; (generated? thing))) - hunk ./module/scsh/syntax-helpers.scm 26 -;;; the following utilities may be superfluous -;;; or rather, is there no overhead for having nested -;;; begins (we're talking... potentially 10+ levels -;;; deep generated by the macro) -;;; of course not. - -;; DEBLOCK maps an expression to a list of expressions, flattening BEGINS. -;; (deblock '(begin (begin 3 4) 5 6 (begin 7 8))) => (3 4 5 6 7 8) - -(define (deblock exp) - (syntax-case exp () - ((expressions ...) - (let deblock1 ((exp exp)) - (syntax-case exp (begin) - ((begin form0 forms ...) - (with-syntax (((rest ...) - (apply append (map deblock1 (syntax (forms ...)))))) - #`(form0 . (rest ...)))) - ((head tail ...) - #'((head tail ...))) - (form #'(form))))))) - -;; BLOCKIFY maps an expression list to a BEGIN form, flattening nested BEGINS. -;; (blockify '( (begin 3 4) 5 (begin 6) )) => (begin 3 4 5 6) - -(define (blockify exp) - #`(begin #,@(deblock exp))) - -(define (thunkate code) - #`(lambda () #,@(deblock code))) - hunk ./module/scsh/syntax-helpers.scm 42 -;;; does not use deblock/blockify/thunkate for now (see above comments -;;; on nested begin efficiency) hunk ./module/scsh/syntax-helpers.scm 93 -