[pmwiki-users] WikiSh - conditional question

Melodye Bowers pbowers at pobox.com
Fri Sep 18 08:25:41 CDT 2009


On Thu, Sep 17, 2009 at 12:22 AM, adam overton <a at plus1plus1plus.org> wrote:

> i was wondering if it's possible to do nested conditiionals in WikiSh in
> the form:
>
> {(wikish if test "blam" == "blammo" || ( test "blee" == "blee" && test
> "blech" == "blech" ); then; echo "true"; else; echo "false"; fi; )}
>
> i would think that it would result in true, but it doesn't work - i think
> the parens break the markup
> i also tried it with [ ] to no avail
>
> i know i could probably break it up into two separate if statements, but am
> wondering if it's possible to do it in a similar form?
>

Unfortunately parentheses have special meaning within a markup expression
and, as such, cannot be used as a syntactical device by a recipe such as
wikish.

commands following && will only be run if the command before the && results
in true.  Commands after || will only be run if the command before the ||
results in false.  Using this knowledge you can create relatively complex
expressions, but I'm afraid parentheses aren't implemented at all at this
point...

Sorry!

-Peter
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.pmichaud.com/pipermail/pmwiki-users/attachments/20090918/7a0203a3/attachment.html 


More information about the pmwiki-users mailing list