This is the mail archive of the guile@cygnus.com mailing list for the guile project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: vectors parsed incorrectly...


> From: Dirk Herrmann <dirk@ida.ing.tu-bs.de>

> guile> #((+ 1 2))
> #((+ 1 2))                     <--- Oops?
> 
> I don't exactly know, how to interpret R5RS on the subject: it says,

> > #(0 (2 2 2 2) "Anna")
> > 
> > Note that this is the external representation of a vector, not an
> > expression evaluating to a vector.

I interpret this as saying: Guile is right.

> > Like list constants, vector constants must be quoted: 
> 
> This can be interpreted (but I don't think so), that is is illegal to use
> the #-syntax without quoting. 

I don't see any other interpretation but
 "must be quoted" = "illegal to use without quoting".

                                 In this case my example above doesn't
> describe something legal and guile's behaviour is conforming (although it
> should give a warning).

A warning would be OK.  Maybe even an error message.

> In my interpretation, it might also be legal to use #-syntax without
> quoting, but in this case the arguments should be evaluated. This would
> mean that guile's behaviour is incorrect.

No, because it is an external representation, not an expression to be
evaluated.  Since there is no expression, there is no procedure call,
and therefore no arguments to evaluated.  It is similar to
"(+ 1 2)" == '"(+ 1 2)" != "(3)"

Indeed, look back at #(0 (2 2 2 2) "Anna"), and ask yourself why it
is not an invalid call to procedure 2.

-- 
     --Keith

This mail message sent by GNU emacs and Linux.
Food, Shelter, Source code.