kawa-commonlisp-dev
[Top][All Lists]
Advanced

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

[Kawa-commonlisp-dev] Appropiate expression class


From: Charles Turner
Subject: [Kawa-commonlisp-dev] Appropiate expression class
Date: Sun, 3 Mar 2013 19:08:23 +0000

Hi all,

For the default values in ordinarly lambda lists, I can't see which
Expression class should properly hold them. My first thought was a
QuoteExp, so to generate the abstract syntax for checking a whether an
argument was passed, I had something like:

new IfExp(new ReferenceExp(supplied_p variable),
            new ReferenceExp(variable passed in),
            new QuoteExp(default value));
                   ^^^^^^^^^

The QuoteExp here isn't right, because with I get results like this:

#|kawa:2|# ((lambda (&optional (x 'a x-p) (y 'b y-p) (z 'c z-p)) (list
x y z x-p y-p z-p)))
((quote a) (quote b) (quote c) () () ())

Here, because the default is of the form (quote x), I'm creating
(quote (quote x)). I'm not sure which Expression class best represents
this "any valid lisp form".

Charles.



reply via email to

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