[Logiweb] sub * is * where * is * end sub

Klaus Ebbe Grue grue at diku.dk
Wed May 10 09:10:47 CEST 2006


Hi Frederik,

> I'm trying to a understand the "sub * is * where * is * end sub" construct. 
> Why does pyk complain about the following test? (For more details, see the 
> eriksen/frozen page).
>
> "[ math test sub       object g equal object g
> is                            object d equal object d
> where object d is
>         object g
> end sub
> end test
> end math  ]"

The "sub ... end sub" is value defined (not macro defined). So evaluation 
of "sub ... end sub" leads to evaluation of the parameters.

"object g" has no value definition, so it evaluates to T by default.
"object g equal object g" also evaluates to T. T is not a parse tree, so 
"sub ... end sub" complains (i.e. returns F).

Solution: put "quote ... end quote" around the parameters: "[ math test 
sub quote object g equal object g end quote is quote ... ]".

Cheers,
Klaus


More information about the Logiweb mailing list