[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Chicken-users] eval and ports
From: |
John Cowan |
Subject: |
Re: [Chicken-users] eval and ports |
Date: |
Wed, 24 May 2006 00:58:13 -0400 |
User-agent: |
Mutt/1.3.28i |
Dan scripsit:
> Maybe I'm just to tired, but the following doesn't
> seem right:
>
> cafe$ csi
> #;1> (let ((o (current-output-port)))
> (eval `(write 1 ,o)))
> Error: invalid syntax: #<output port (stdout)>
>
> It works in SISC, but bombs in Guile and Scsh. What am
> I missing? And how can I pass a port value to an
> eval'd expression ?
You need to use ',o rather than ,o; a port object can't appear unquoted
in a Scheme form. Some implementations allow arbitrary unquoted data
objects in forms, but that's an extension -- for example, in Chez you
can write "(define foo ())" instead of "(define foo '())".
--
John Cowan <address@hidden> http://www.ccil.org/~cowan
But no living man am I! You look upon a woman. Eowyn I am, Eomund's daughter.
You stand between me and my lord and kin. Begone, if you be not deathless.
For living or dark undead, I will smite you if you touch him.