Re: Mason 2.0 thoughts

Jonathan Swartz <[email protected]> Mon, 14 May 2007 09:57:24 -0700
Newsgroups gmane.comp.web.mason.devel
Message-ID <[email protected]>
> Also, speaking of lexicals that are far, far away, getting at %ARGS
> (another lexical, IIRC) is painful(/"impossible") from inside escape
> routines.  In my web app framework, I save off component args before
> calling Mason so I can get at them later, but I only hook in at the
> top level.  When a component calls another component, I'm not there to
> snag the args.  (AFAIK, there's no easy place to hook in for that.)
> So, either %ARGS as a (possibly local()ized) package var, or a new
> place to get at the %ARGS passed to the current component would be
> nice :)

How about $m->caller_args? Called with 0, it gives the arguments to  
the current component.

     http://www.masonhq.com/docs/manual/Request.html#item_caller_args

That isn't technically the same as %ARGS, because %ARGS is a copy of  
the arguments that can be changed inside the component...but I expect  
it's good enough for your needs.

>
> Inlining is your friend :)  And speaking of efficiency, coalescing
> multiple $m->print() calls into fewer calls with multiple args might
> buy some speed.

Have you set enable_autoflush => 0?

     http://www.masonhq.com/docs/manual/Admin.html#disabling_autoflush

Unless you are actually using autoflush, you should set this; it will  
replace the generated $m->print calls with simple inline appends to a  
buffer. Only reason this is not the default is because it would break  
current autoflush users.

Jon


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/