[Omake] test is always true???

Aleksey Nogin nogin at metaprl.org
Mon May 28 20:17:11 PDT 2007


On 28.05.2007 09:36, Christopher L Conway wrote:

> In the following OMakefile, test returns true in every case. Am I
> missing something about the arguments to test?
[...]
> if test -n $(X)
>    println( 1. $(X) is non-null )

Note that here you are not calling the test function (this is not shell
syntax!), you are just asking the "if" to see if the sequence "test -n
$(X)" is false - and it's obviously not.

The correct syntax for function calls is $(function arg arg ... arg). In
your case, you need

if $(test -n $"$(X)")
   ...

Note that the reason for using the $"..." quotation form is the same as
for the "..." quotation in shell syntax.

Aleksey


More information about the Omake mailing list