[Petal] [rfc] if: ... then: ... else: ... modifier

William McKee william at knowmad.com
Fri Sep 19 10:20:18 BST 2003


On Fri, Sep 12, 2003 at 02:58:39PM +0100, Steve Purkis wrote:
> I agree that 'then:' and 'else:' make the syntax look a bit more 
> complex, but it's something I think most people can live with.  The 
> main reason for its existence is one of parsing - how do you figure out 
> that the first two arguments of this expression:

Ok, I can see your logic and agree that it's better to live with the
extra syntax.


> >However, this example brings up a problem I had with the date: modifier
> >where I was trying to pass in a string to be used as the separator.
> >Jean-Michel claims I should be able to do it, but I did not have any
> >luck.
> 
> You should be able to do it with 'string: foo', no?

I get the following parsing error:

Error: Cannot access hash at '' with parameters (near $date3 string:-)
at /usr/local/share/perl/5.6.1/Petal/Hash/Var.pm line 101


You can try it yourself by modifying line 14 in t/data/basic.html and
uncommenting line 89 in t/02__default.t.


William

-- 
Knowmad Services Inc.
http://www.knowmad.com


More information about the Petal mailing list