On Wed, Nov 26, 2008 at 03:23:55PM +0000, Nicholas Clark wrote:
> On Wed, Nov 26, 2008 at 12:38:10PM +0100, Rafael Garcia-Suarez wrote:
> > 2008/11/26 Rafael Garcia-Suarez <rgarciasuarez@gmail.com>:
> > > 2008/11/26 Nicholas Clark <nick@ccl4.org>:
> > >> On Wed, Nov 26, 2008 at 10:35:02AM +0000, Nicholas Clark wrote:
> > >>> On Mon, Nov 24, 2008 at 04:36:01PM +0100, Rafael Garcia-Suarez wrote:
> > >>> > 2008/11/24 Nicholas Clark <nick@ccl4.org>:
> > >>>
> > >>> > > 3: Perl_linklist()
> > >>> >
> > >>> > On one hand, this method could be made static.
> > >>> > On the other hand, that's a nice way to walk an optree. And the interface
> > >>> > is so simple and generic that it can survive any internal change :)
> > >>>
> > >>>
> > >>> Well, it's essentially unchanged since revision 1, so it seems safe enough
> > >>> to expose. What's the best way to document it? Right now, the entire
> > >>> documentation is /* establish postfix order */
> > >
> > > Hmm. After compilation, that only returns op_next, the next op to be
> > > executed. During compilation, if op_next isn't set yet, it figures out
> > > which op comes next and stores it in op_next.
> >
> > ... which also means that it should probably not be public, if we
> > follow the logic that the optree construction should not be public;
> > Devel::BeginLift is already copying parts of op.c to do its magic.
>
> Do we want to make that policy decision? That optree construction is private.
linklist() is an interesting question.
The basic problem BeginLift has is that it wants to take a half-built optree
and finish compiling it, then run it.
It sort of seems to me like a "finish up this optree" function might be really
useful.
Interestingly, B::Generate provides a $op->linklist in perl, complete with
comment "# This is where we implement op.c in Perl. Sssh." :) which I think
proves that the function is worthwhile.
I suspect the remaining XS in there is basic bookkeeping that can happily
use the current public API.
--
Matt S Trout Need help with your Catalyst or DBIx::Class project?
Technical Director http://www.shadowcat.co.uk/catalyst/
Shadowcat Systems Ltd. Want a managed development or deployment platform?
http://chainsawblues.vox.com/ http://www.shadowcat.co.uk/servers/
Thread Previous
|
Thread Next