[perl #41881] [CAGE] Redo CONTEXT(interp->ctx)->foo

1 view
Skip to first unread message

Paul Cochrane

unread,
Mar 17, 2007, 4:09:13 PM3/17/07
to bugs-bi...@rt.perl.org
# New Ticket Created by Paul Cochrane
# Please include the string: [perl #41881]
# in the subject line of all future correspondence about this issue.
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=41881 >


From cage/todo.pod:

Eliminate the C<< CONTEXT(interp->ctx)->foo >> usage in favor of
the much simpler C<< interp->ctx->foo >>, or similar simplification

Jonathan Worthington

unread,
Mar 17, 2007, 5:51:09 PM3/17/07
to perl6-i...@perl.org
Paul Cochrane (via RT) wrote:
> From cage/todo.pod:
>
> Eliminate the C<< CONTEXT(interp->ctx)->foo >> usage in favor of
> the much simpler C<< interp->ctx->foo >>, or similar simplification
>
Yes, it's shorter and simpler but I'm not sure eliminating having some
macro there is the Right Thing To Do. Already before now there has been
discussion about making contexts garbage collectable. Wrapping access to
the context in a macro means that such a move in the future would be
easier, if that were to happen.

Just my 2 pennies. :-)

Jonathan


Chromatic

unread,
Mar 15, 2008, 1:56:46 AM3/15/08
to parrot-...@perl.org, Jonathan Worthington, perl6-i...@perl.org
On Saturday 17 March 2007 14:51:09 Jonathan Worthington wrote:

> > Eliminate the C<< CONTEXT(interp->ctx)->foo >> usage in favor of
> > the much simpler C<< interp->ctx->foo >>, or similar simplification

> Yes, it's shorter and simpler but I'm not sure eliminating having some
> macro there is the Right Thing To Do. Already before now there has been
> discussion about making contexts garbage collectable. Wrapping access to
> the context in a macro means that such a move in the future would be
> easier, if that were to happen.

The attached patch (for review, and certainly not application until after the
0.6.0 release) changes CONTEXT(interp->ctx) to CONTEXT(interp), which seems
clearer to me.

All tests pass for me. Comments welcome.

-- c

context_macro_change.patch

Bob Rogers

unread,
Mar 15, 2008, 9:22:31 PM3/15/08
to chromatic, parrot-...@perl.org
From: chromatic <chro...@wgz.org>
Date: Fri, 14 Mar 2008 22:56:46 -0700

The attached patch (for review, and certainly not application until
after the 0.6.0 release) changes CONTEXT(interp->ctx) to
CONTEXT(interp), which seems clearer to me.

Yes indeed.

All tests pass for me. Comments welcome.

-- c

Works for me in r26395 (but I only have x86/Linux available, so you
probably already knew that).

FWIW, the first five matches to "interp))" in the patch have double
parens around the "interp" arg.

-- Bob Rogers
http://rgrjr.dyndns.org/

Reply all
Reply to author
Forward
0 new messages