I need some help interpreting
Posted: Thu Jul 01, 2010 10:12 pm
Hi
I use a program called Fluent, in which one can use scheme-snippets to automate certain things.
I have obtained a snippet that I use but I can't really understand what each line does. The snippet works, but I want to be able to modify it, and thus I need to understand it.
The code looks like this:
The above is stored in a file called Report.scm
I call it by using the following
Can anyone help me interpreting this stuff?
Best regards from Sweden
I use a program called Fluent, in which one can use scheme-snippets to automate certain things.
I have obtained a snippet that I use but I can't really understand what each line does. The snippet works, but I want to be able to modify it, and thus I need to understand it.
The code looks like this:
Code: Select all
(define filter
(let ((mywallthreads '()) (mythreads '()) (mythreadtypes '()) (threadtype '()))
(lambda ()
(set! mythreads (map thread-name (get-face-threads)))
(set! mythreadtypes (map thread-type (get-face-threads)))
(set! mywallthreads '())
(set! threadtype 'wall)
(do ((i 0 (+ i 1)) )
((= i (- (length mythreads) 1)))
( if (eq? threadtype (list-ref mythreadtypes i)) (set! mywallthreads (cons (list-ref mythreads i) mywallthreads )))
)
(vector->list (list->vector mywallthreads))
)
)
)
(define report-wall-file
(lambda (rep-type quantity savefile filename)
(ti-menu-load-string (format #f "re surf ~a ~a ~a ~a ~a"
rep-type
(filter)
quantity savefile filename))))
I call it by using the following
Code: Select all
/file/read-macros Report.scm
(report-wall-file 'area 'pressure 'yes 'output.srp)
Best regards from Sweden