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
tom.rmadilo

2008-01-31, 4:53 am

On Jan 30, 9:04 pm, Darren New <d...@san.rr.com> wrote:
> tom.rmadilo wrote:
>
> [return] is the same thing as [break] and [continue] and [error], except
> returning different values. You do know that, right?


Where exactly do they return their values? [return], [break] and
[continue] and [error] are similar. None of them return a value to the
context in which they are called, or any other (although [return] and
[error] are somewhat ambiguous at the Tcl level, they set a Tcl
result, but the commands don't return a value). You do know the
difference between returning a value at the C level and a Tcl command
returning a value to the Tcl scripting level? Two different things.
But [break] and [continue] don't even return to the Tcl scripting
level. Maybe you don't distinguish between what a command can cause
another chunk of code to return and the actual return value of the
command itself? But I'm somewhat , where exactly would these
commands return? Return, and do what exactly? Like, oops, not
supposed to be here, bye.
Sponsored Links







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

Copyright 2008 codecomments.com