For Programmers: Free Programming Magazines  


Home > Archive > Tcl > January 2008 > Re: Why doesn't foreach return a value









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: Why doesn't foreach return a value
Mark Janssen

2008-01-30, 7:46 pm

On Jan 30, 7:57 pm, "tom.rmadilo" <tom.rmad...@gmail.com> wrote:
> On Jan 30, 10:40 am, Mark Janssen <mpc.jans...@gmail.com> wrote:
>
>
>
>
>
>
>
>
>
>
>
>
> One other observation is that there is a confusion here between the
> logical meaning and technical details like the internal implementation
> or the ability of Tcl to introspect this internal stuff:
>
> proc my_proc { vars } {
> foreach var $vars {
> upvar $var $var
> }
> ...
>
> }
>
> If the foreach callframe were a logical callframe/level, you couldn't
> do the above. Many things would become difficult to understand, or
> even impossible to do, and would depend upon knowledge of internal
> details of a procedure.


The foreach frame *is* a logical level. Just one you cannot get at
from the body as that is upleveled.
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com