On 24-Sep-07, at 11:53 PM, andrew cooke wrote:
[Not sure whether to use Gambit or Snow list - hope duplication not a problem]
I have just installed Gambit (4.0.1), Termite (tarball) and Snow (1.1.1). Things seem OK, in that the following works:
gsi
Gambit v4.0.1
(self)
#<thread #1 primordial>
So I then defined the following in a Snow package:
(cond-expand (gambit (define (acu-pmap f lst) (let ((parent (self))) (map (lambda (pid) (recv ((,pid reply) reply))) (map (lambda (x) (spawn (lambda () (! parent (list (self) (f x)))))) lst))))) (else (define (acu-pmap f lst) (map f lst))))
However, when I try to use code that calls acu-pmap I get the error (line 30 is the "let"): *** ERROR IN ac-utils/v1#acu-pmap, "ac-utils.scm"@30.20 -- Unbound variable: ac-utils/v1#self
Can anyone suggest why this doesn't work and/or how I can fix it?
Thanks, Andrew
Snow will prepend the package name to "self", i.e "mypack#self", because self is not imported from another package. I suggest you (or Guillaume Germain) write a "termite" package which exports functions like self, make-node, etc. Alternatively just add this namespace declaration at the top:
(##namespace ("" self make-node))
You will need to add all the Termite functions/special forms that you want to import.
Marc