From: Richard G. <rg...@ta...> - 2001-07-31 13:41:12
|
On Tue, 31 Jul 2001, Martin Gasbichler wrote: > > > >(define file-to-swap > > (lambda (fname sf1 . sfiles) > > (let* ((net (net-new)) > > (rf (net-add-node net read-file `("filename" ,fname)))) > > (map (lambda (sf) > > (nodes-connect `(,rf ,(net-add-node net > >"swapfile-out" `("filename" ,sf) `("flags" 3))))) > > (cons sf1 sfiles)) > > (net-run net)))) > > Uuuaahh, what the hell are you doing here? Backquoting is normally > used if you have more objects to quote than expressions which should > be evaluated. You don't need a single quote in the code above! Simply > use LIST. Furthermore, if you map a function over a list but you're > only interested in the side-effects, use FOR-EACH instead of > MAP. Finally, some newlines make the code much more readable: Similar things apply to the following? (define (filternode_set_param node label value) (call-with-current-continuation (lambda (return) (map (lambda (param) (if (string=? (param-label param) label) (return (param-set! param value)))) (filter-params node)) #f))) Richard :) -- Richard Guenther <ric...@un...> WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/ The GLAME Project: http://www.glame.de/ |