[pmwiki-users] {(...)} markup recipe available

Ben Stallings ben at interdependentweb.com
Wed Apr 11 14:17:30 CDT 2007


Patrick R. Michaud wrote:
> It may need some serious tweaking, because {(...)} always
> expects the operation to be at the front, while {( ? : )} seems
> to have its operators in the middle.  If I were doing this
> from scratch, I would probably write it as:
> 
>   {(if cond true false)}

That's so similar to (:if cond:)true(:else:)false(:endif:) that I don't 
think it needs a separate markup... provided that {()} functions can be 
used inside of (:if:) conditionals, which I haven't tested yet.

> I didn't realize that SelectQuery was using {(...)} as a 
> markup sequence, so my profound apologies if this development 
> is now clobbering that.

Apology gratefully accepted... I readily admit that the ternary markup 
in SelectQuery was a kludge I adopted because I was under time pressure 
and couldn't figure out why I wasn't able to get $Conditionals to work. 
  I meant to replace it with proper PmWiki conditionals months ago.  But 
I've been working on DataQuery/DataPlates instead, and now Guy is 
working on SelectQuery, so it hasn't gotten fixed.

But... it seems to me that the purpose of {()} markup is to make PHP 
functions available inside PmWiki, which is basically the same as what I 
was doing with {( ? : )} -- anything before the ? is actually evaluated 
as a PHP expression (Danger, Will Robinson!) so *any function at all* 
can go in there without needing to be defined separately in PmWiki.

That's probably more power than we want people to have.  But hey, it's 
escaped exploitation so far... :-)  --Ben



More information about the pmwiki-users mailing list