develooper Front page | perl.perl6.language | Postings from August 2001

Re: new syntax idea: eval "..."o;

Thread Previous | Thread Next
From:
Marc-Oliver Ihm
Date:
August 8, 2001 04:54
Subject:
Re: new syntax idea: eval "..."o;
Message ID:
OF0B106C04.42C2C07C-ON41256AA2.00468AE2@allgemeine-kredit.de

> On Tue, 7 Aug 2001 09:27:43 -0400, John Porter wrote:
>
> >David L. Nicol wrote:
> >>      eval ${code}o;
> >
> >Another brilliant idea from David Nicol!
>
> Not really.
>
> What I would like is an option to just *compile* a piece of perl code,
> without executing it. This kinda works:
>
>    $coderef = eval "sub { $code }";
>
> and currently (5.6.0) even if $code contains sub definitions; but it's
> still just a hack.

How about having an EVAL object-type ? (somewhat analogous to the
relationship between INT and int)

     my $compiled=new EVAL($code);
     $compiled.execute;

The constructor just compiles and the execute method just executes.

-- Marc --


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About