[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Chicken-users] eval works different in Chicken 4.7 from 3.4?

From: Christian Kellermann
Subject: Re: [Chicken-users] eval works different in Chicken 4.7 from 3.4?
Date: Mon, 3 Oct 2011 10:11:32 +0200
User-agent: Mutt/1.5.21 (2010-09-15)

Hi Matt,

* Matt Welland <address@hidden> [111003 06:53]:
> The below code used to do a fine job of eval'ing a hodge-podge file of lists
> and strings but in Chicken4.7 the eval doesn't seem to see compiled routines
> in the parent code. Has eval changed in some incompatible way or do I need
> to keep digging for some other bug :) ?
> (let* ((p      (open-input-file view))
>         (map (lambda (x)
>             (cond
>              ((list? x) x)
>              ((string? x) x)
>              (else '())))
>               (port-map eval (lambda ()(read p))))))

I am not sure I have understood your problem correctly. What I tried was:

(use ports)
(let* ((p (open-input-file "view.scm")))
       (map (lambda (x)
               ((list? x) x)
               ((string? x) x)
               (else '())))
            (port-map eval (lambda ()(read p)))))

(I had to correct some parenthesis there, I guess this was a typing error on 
your side).

(define foo (+ 1 2))
(print foo)

and then the interpreter:
$ csi -nq test.scm 

and compiled:
$ ./test

So I am not sure what your problem is. What does your input look
like and what do you expect? What happens instead?

Kind regards,


Who can (make) the muddy water (clear)? Let it be still, and it will
gradually become clear. Who can secure the condition of rest? Let
movement go on, and the condition of rest will gradually arise.
 -- Lao Tse. 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]