in reply to Re: Re: Re: RFC: Transactions.pm
in thread RFC: Transactions.pm

Of course you can write that as
transaction $dbh => sub { ... };
as well. You know, thinking about this topic, it occured to me that this is where Perl6 user exposed parsing would allow us to superimpose such features on the language seamlessly, without all the caveats inherent to Perl5 solutions.

Makeshifts last the longest.

Replies are listed 'Best First'.
Re^5: RFC: Transactions.pm
by Jenda (Abbot) on Apr 28, 2003 at 14:34 UTC

    Yeah I know. It's the sub that looks kinda strange there.

    You are probably right about Perl6. I've tried to read a few Apocalypses&Exegei, but do not remember much. I need something to experiment with to grok such stuff.

    Jenda
    Always code as if the guy who ends up maintaining your code will be a violent psychopath who knows where you live.
       -- Rick Osborne

    Edit by castaway: Closed small tag in signature

Re: Re^4: RFC: Transactions.pm
by Juerd (Abbot) on Apr 28, 2003 at 15:03 UTC

    it occured to me that this is where Perl6 user exposed parsing would allow us to superimpose such features on the language seamlessly, without all the caveats inherent to Perl5 solutions.

    You won't have to change the grammar or have a "parsed" trait on an operator. Every block is a closure, so something like this will work:

    multi transaction (Object $object, &block) { ...; block(); ...; }
    transaction $dbh -> { ... }
    (Note: this is probably wrong, but I can't check it since I don't have a working Perl 6 interpreter :)

    Juerd # { site => 'juerd.nl', plp_site => 'plp.juerd.nl', do_not_use => 'spamtrap' }