Re: Why doesn't foreach return a value



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



Relevant Pages

  • Re: Why doesnt foreach return a value
    ... Every Tcl command is implemented as a C level function. ... What we want at the script level is the ... What changes occur is very specific to the context. ...
    (comp.lang.tcl)
  • ANN: AOLserver 4.5.0 released!
    ... On behalf of the AOLserver Team, I have the honor of announcing the ... AOLserver 4.5.0 is a major upgrade including several new Tcl commands, ... AOLserver is America Online's Open-Source web server. ... the "ns_zlib" command for compressing and uncompressing ...
    (comp.lang.tcl)
  • Tcl-URL! - weekly Tcl news and links (Mar 5)
    ... GRIDPLUS2 is a Tile based version of GRIDPLUS. ... *) New "gpselect" command to select a tablelist row or tree node. ... Some people take their license issues very personal indeed;-) (and ... Word documents via Tcl and tcom - ...
    (comp.lang.tcl)
  • Re: Core commands as ensembles...
    ... command that does much the same as [namespace code], ... TCL as their scripting/console engine. ... home-brew bits and pieces, in which I will use TCL in any way that I ...
    (comp.lang.tcl)
  • Re: Can Ruby read emails?
    ... command, and Ruby will read it and exacute that command. ... I actually wrote a system using Tcl some years back which used ... e-mail to "move" a software agent from one host to another. ...
    (comp.lang.ruby)