[q-lang-users] quote evaluation
Brought to you by:
agraef
From: Kristof B. <kr...@vl...> - 2006-08-01 15:56:06
|
Hi, first I'd like to say that Q is an interesting language, and it is surprising to find such a complete documentation for a relatively unknown language. I find special forms particularly interesting. I wrote part of a library to write html pages as expressions, where you can write an html tag as function application (like scheme sxml). For example: (to_html (html (head (title ~Homepage)) (body (h1 ~Title) (a (href = "www.url.org/adress") "ref")))) => a nested html object 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? I would think that quote is a special form which doesn't evaluate it's argument. 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. Regards, Kristof Bastiaensen |