jcoglan / fargo

Lisp with fibers for Node.js
http://fargo.jcoglan.com
157 stars 10 forks source link

Evaluation error of lists as arguments within fibers #5

Open adityagodbole opened 12 years ago

adityagodbole commented 12 years ago
(define (sum a)
  (if (null? (cdr a))
    (car a)
    (+ (car a) (sum (cdr a)))))
(let [(a (list 1 2 3))]
  (puts (sum a)))

(define prog (fiber ()
   (let [(a (list 1 2 3))]
     (puts (sum a)))))
(prog)

The above code results in the following output and error:

The "sys" module is now called "util". It should have a similar interface.
6

node.js:201
        throw e; // process.nextTick error, or 'error' event on first tick
              ^
Error: Invalid expression: (1 2 3)
    at [object Object].process (/Users/aditya/prog/js/fargo/build/fargo.js:3662:17)
    at [object Object].process (/Users/aditya/prog/js/fargo/build/fargo.js:3561:25)
    at [object Object].clear (/Users/aditya/prog/js/fargo/build/fargo.js:3554:14)
    at [object Object].push (/Users/aditya/prog/js/fargo/build/fargo.js:3545:12)
    at [object Object].eval (/Users/aditya/prog/js/fargo/build/fargo.js:2903:34)
    at [object Object].evaluate (/Users/aditya/prog/js/fargo/build/fargo.js:35:23)         
    at [object Object].call (/Users/aditya/prog/js/fargo/build/fargo.js:3060:25)
    at [object Object].process (/Users/aditya/prog/js/fargo/build/fargo.js:3665:27)
    at [object Object].process (/Users/aditya/prog/js/fargo/build/fargo.js:3561:25)
    at [object Object].clear (/Users/aditya/prog/js/fargo/build/fargo.js:3554:14)