ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> tcl-core
tcl-core
Re: [TCLCORE] Tcl-Core Digest, Vol 24, Issue 5
by Donal K. Fellows other posts by this author
May 5 2008 3:26AM messages near this date
Re: [TCLCORE] Tcl-Core Digest, Vol 24, Issue 5 | Re: [TCLCORE] Pre-CFV: TIP#257
Twylite wrote:
>  That said I recognise that there are developers who find implicit 
>  variable access an advantage, and I can respect that (even if they are 
>  wrong ;) ).  I believe the following code inserted at the start of a 
>  method will accomplish the desired functionality?
>    foreach v [info object vars [self object]] {
>      my variable $v
>    }
>  
>  To make it simple perhaps a proc import_object_vars that uplevels that 
>  code snippet.

Might be better to use a variable resolver. But that's deep voodoo (and
not something I understand fully either).

[Things without deep thought follow]
>  Would it be worth considering an additional "meta" parameter to a method 
>  definition (before or afeter the argslist).  Such a parameter could be 
>  used in future to extend the functionality of methods without breaking 
>  the interface.
>  For example:
>    - oo::define c method my_func {autovars true} {args} { ... }
>  In this case meta is treated as a dict, and TclOO knows about the 
>  "autovars" value which will cause the object's variables to be 
>  implicitly brought into scope (like import_object_vars above)

It might be better to think in terms of several modes of operation. So
you can have "none" (the current behaviour), "declarer" (only the vars
from the class declaring the method), "super" (the vars from the class
declaring the method and its superclasses) and "all" (all vars defined
on the object, including those from the subclasses of the class
declaring the method). There might be other modes too; those are just
the obvious thought of in about 10 seconds. :-)

>    - oo::define c method my_func {pointtag t} {args} { ... }
>  In the future some support for Aspects is added.  If an enter/leave 
>  action is associated with any of the listed pointcut tags (in this case 
>  "t") then that action will be executed in the context of the method 
>  before the body (in the case of enter) or at the point of return (leave).
>    - oo::define c method my_func {pointcut [list ::mycallback arg1]} 
>  {args} { ... }
>  Also for Aspect support, define a specific method to invoke rather than 
>  a tagged action.  This specific case is equivalent to trace enter / 
>  trace leave.

I don't understand the use-cases quite thoroughly enough yet; a full
worked example would make my life easier.

>  I know it may be a bit late in the dev cycle to be raising new ideas, 
>  but I didn't think of it before ;p  Is there any merit in this?

A specific goal of TclOO was to be flexible enough to support this sort
of thing, so no, it's not too late. Might not get done before the vote,
but should be possible to fit afterwards.

Donal.

-------------------------------------------------------------------------
This SF.net email is sponsored by the 2008 JavaOne(SM) Conference 
Don't miss this year's exciting event. There's still time to save $100. 
Use priority code J8TL2D2. 
http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone
_______________________________________________
Tcl-Core mailing list
Tcl-Core@[...].net
https://lists.sourceforge.net/lists/listinfo/tcl-core
Thread:
Twylite
Will Duquette
Kevin Kenny
Kevin Kenny
Will Duquette
Arnulf Wiedemann
Will Duquette
Kevin Kenny
Donal K. Fellows
Twylite
Larry W. Virden
Twylite
Gustaf Neumann
Larry McVoy
Gerald W. Lester
Vasiljevic Zoran
Larry McVoy
Gerald W. Lester
Larry McVoy
Tomasz Kosiak
Gustaf Neumann
Donal K. Fellows
Daniel A. Steffen
Donal K. Fellows
Daniel A. Steffen
Donal K. Fellows
Donal K. Fellows
Daniel A. Steffen
Gerald W. Lester
Vasiljevic Zoran
Arnulf Wiedemann
Tom Krehbiel
Vasiljevic Zoran
Donal K. Fellows
Gustaf Neumann
Brian Griffin
Gustaf Neumann
Donal K. Fellows
Gustaf Neumann
Kristoffer Lawson
Daniel A. Steffen
Twylite
Donal K. Fellows
Will Duquette
Donal K. Fellows
Will Duquette
Arnulf Wiedemann
dgp
Donal K. Fellows
Arnulf Wiedemann
Twylite
Will Duquette
Twylite
Donal K. Fellows
Stefan Sobernig
Donal K. Fellows
Stefan Sobernig

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved