> ---- snip -------
>> However I came across the following strange behaviour. In the
>> equation:
>>
>> test '(A B) = ('A, 'B);
>>
>> I would expect test '(a (2 + 3)) to evaluate to ('a, '(2 + 3)),
>> however it evaluates to ('a, '5). Is this the defined behaviour?
>
> Yes, it is, but only since Q 7.1. The general rule is that, while
> special arguments of a function will never be evaluated, deferred
> subterms inside a _non-special_ arg are evaluated automatically when
> they are needed in the pattern matching process. This is a
> convenience so that non-special functions can assume matched
> subterms to be in (weak) normal form, which is important to make
> functions operating on lazy data structures such as streams do the
> right thing.
Yes, it makes more sense now!
>> Also, when using the Q interpreter to write scripts, it always
>> prints the last object to stdout. Is there an option to turn it
>> off? If I want to write a script that outputs some text, I
>> wouldn't want the output to be clobbered with an object.
>
> Explicitly exiting from the program with `exit 0' probably does what
> you want.
Thanks, that does the trick.
If I get a working version of my html library, I'll let it know, and
post it somewhere!
Regards,
Kristof
|