Re: Why doesn't foreach return a value
- From: "tom.rmadilo" <tom.rmadilo@xxxxxxxxx>
- Date: Thu, 31 Jan 2008 00:16:27 -0800 (PST)
On Jan 30, 9:04 pm, Darren New <d...@xxxxxxxxxx> wrote:
tom.rmadilo wrote:
You don't usually [return] from a loop. (You can, but the [return] is
applied to the context, not the loop boundary.
[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 confused, where exactly would these
commands return? Return, and do what exactly? Like, oops, not
supposed to be here, bye.
.
- References:
- Re: Why doesn't foreach return a value
- From: Rufus V. Smith
- Re: Why doesn't foreach return a value
- From: Mark Janssen
- Re: Why doesn't foreach return a value
- From: tom.rmadilo
- Re: Why doesn't foreach return a value
- From: Darren New
- Re: Why doesn't foreach return a value
- From: tom.rmadilo
- Re: Why doesn't foreach return a value
- From: Darren New
- Re: Why doesn't foreach return a value
- Prev by Date: Re: Why doesn't foreach return a value
- Next by Date: Re: Why doesn't foreach return a value
- Previous by thread: Re: Why doesn't foreach return a value
- Next by thread: Re: Why doesn't foreach return a value
- Index(es):
Relevant Pages
|