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] Variable access (was Re: [Tcl9-cloverfield], Parser)
by Larry McVoy other posts by this author
May 9 2008 6:31AM messages near this date
Re: [TCLCORE] Variable access (was Re: [Tcl9-cloverfield], Parser) | Re: [TCLCORE] Variable access (was Re: [Tcl9-cloverfield], Parser)
>  I believe Fr?d?ric is suggesting that it is equivalent to an implicit 
>  upvar on the name (in the scope of the called proc), but guarantees that 
>  the variable exists.  Using upvar currently provides no such guarantee 
>  because the variable name is a weak reference.
>  >      proc foo v { ... }
>  >      foo $&bar
>  >
>  > is roughly equivalent to:
>  >
>  >      proc foo vName { upvar 1 $vName v; ... }
>  >      foo bar
>  >
>  > Is that correct?

This is very similar to what we already have implemented in L.  The &var
syntax is just syntatic sugar for the implied upvars as needed in the
callee; the caller, it means pass the name of the variable instead of
the value.

Seems to work quite well.
-- 
---
Larry McVoy                lm at bitmover.com           http://www.bitkeeper.com

-------------------------------------------------------------------------
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
Larry McVoy
Rna020
Neil Madden
Twylite
Neil Madden
Twylite
Neil Madden

Privacy Policy | Email Opt-out | Feedback | Syndication
© 2004 ActiveState, a division of Sophos All rights reserved