This is the mail archive of the
kawa@sources.redhat.com
mailing list for the Kawa project.
Re: Compiling procedures questions
- From: Per Bothner <per at bothner dot com>
- To: "Crystal, Mayer" <mayer dot crystal at gs dot com>
- Cc: "'kawa at sources dot redhat dot com'" <kawa at sources dot redhat dot com>
- Date: Tue, 28 Sep 2004 12:13:54 -0700
- Subject: Re: Compiling procedures questions
- References: <7F7603A85B0C674D9834EC479BE4F884067712DC@gsnmp27es.ny.fw.gs.com>
Crystal, Mayer wrote:
When I run the main of KawaTest the output of the println statement is:
Procedure value = #<procedure proc1?>
What I was trying to do though was to get the result as true or false.
It is. #<procedure proc1?> is a true value.
R5RS says:
library syntax: (or <test1> ...)
The <test> expressions are evaluated from left to right, and the value
of the first expression that evaluates to a true value (see section
6.3.1) is returned.
and:
The standard boolean objects for true and false are written as #t and
#f. What really matters, though, are the objects that the Scheme
conditional expressions (if, cond, and, or, do) treat as true or false.
The phrase ``a true value'' (or sometimes just ``true'') means any
object treated as true by the conditional expressions, and the phrase
``a false value'' (or ``false'') means any object treated as false by
the conditional expressions.
Of all the standard Scheme values, only #f counts as false in
conditional expressions. Except for #f, all standard Scheme values,
including #t, pairs, the empty list, symbols, numbers, strings, vectors,
and ***procedures***, count as true.
You probably meant:
private static final String TEST_RULE = "(or (proc1?) (or (proc2?)
(proc3?)))";
--
--Per Bothner
per@bothner.com http://per.bothner.com/