在 Dec 7, 2006 12:37 AM 時,Jesse Vincent 寫到:
On Thu, Dec 07, 2006 at 12:27:59AM +0800, Audrey Tang wrote:
Next question: If I can make this work, would you be happy to see it
happen?

    div {
          attr { id => 'foo' }
          p { 'some text -- semicolon is optional after the closing
brace!' }
          p { 'some more text...' }
    }

If it's predictable, yes, that would be lovely.

I think it is.  That is, we can sequence side effects just fine:

    my $x = 0;
    div { p { $x++ } p { $x++ } p { $x++ } }

will still output 0/1/2, not 2/1/0.

The trick here is (again) context-driven katamari: Under scalar context the block is suspended without actually executing, and the statement-level void context tag takes care of executing the pending sequence in order. If you're up for coding it tonight it'd be cool, otherwise I'll do it over the weekend.

Thanks,
Audrey_______________________________________________
jifty-devel mailing list
[email protected]
http://lists.jifty.org/cgi-bin/mailman/listinfo/jifty-devel

Reply via email to