I'm almost afraid to ask, but is there a goto statement in Tcl?
There's nothing in the index of 'Tcl and the Tk Toolkit' by Ousterhout
and I don't have access to any of the manpages for Tcl, so I'm stuck.
Can anyone give me details on the goto statement if one does indeed
exist? How labels work, etc etc.
I'd be very appreciative, thanks,
Max
--
Max Stevens mste...@mprgate.mpr.ca or joms...@uwaterloo.ca
Any man, in the right situation, is capable of murder. But not any man
is capable of being a good camper. So, murder and camping ar not as
similar as you might think.
Nope. And I haven't missed it, although I have used it in C once or
twice... There is probably an equally good way to do whatever you want.
--
Jeffrey Hobbs Office: 541/346-3998
Univ of Oregon CIS GRF email: jho...@cs.uoregon.edu
URL: http://www.cs.uoregon.edu/~jhobbs/
Tcl does not have a goto statement.
An now for a religious opinion, you don't really need one in any
reasonable language.
**********************************************************************
* Gerald W. Lester | Voice: +1 (504)-889-2784 *
* Computerized Processes Unlimited, Inc. | FAX: +1 (504)-889-2799 *
* 4200 S. I-10 Service Rd., Suite 205 | E-Mail: g...@cpu.com *
* Metairie, LA 70001 | WWW: http://www.cpu.com *
* "Consulting System Integrators" *
**********************************************************************
It's also worth noting that Tcl has exceptions (of a sort) with "error"
and "return -code ..." for raising them and "catch" for, well, catching
them.
--
John Haxby
These are my opinions, not my employer's.
And of course, 'reasonable' means high level language, so there's
no need to post all the places in assembler where goto is needed.
--
:s Larry W. Virden INET: lvi...@cas.org
:s <URL:http://www.teraform.com/%7Elvirden/> <*> O- "We are all Kosh."
:s Unless explicitly stated to the contrary, nothing in this posting should
:s be construed as representing my employer's opinions.
I disagree, all languages that I know of have goto functionality even if
it isn't called goto. In tcl break, continue and return are goto's,
their functionality is admittedly very restricted though. Event based
callbacks could also be considered as goto though I have to admit that
it is a little obscure.
--
© 1995,1996 Michael Salmon
All opinions expressed in this article remain the property of
Michael Salmon. Permission is hereby granted for use in
followup articles, FAQ's and digests.
All control structures are just goto in disguise, break/continue/return
no more so than if and while. The restrictions on functionality are not
incidental; they are the important part.
Break/continue/return are odd only if you belong to the Single Entry
Single Exit sect, which claims that all control structures should have
one entry point (fairly uncontroversial) and one exit point (highly
debatable). While there is something to be learned from them, the SESE
fanatics take the basic principle much too far, and the result of strict
adherence to their beliefs tends to be complicated, deeply-nested messes
which can be simplified dramatically with a few returns.
--
...the truly fundamental discoveries seldom | Henry Spencer
occur where we have decided to look. --B. Forman | he...@zoo.toronto.edu
Well, suppose I want to translate some other scripting
language into Tcl. Suppose that other language has
a GOTO statement. How do I convert arbitrary GOTO statements
into Tcl?
[I *know* of several ways to do it myself, but none of them are
nearly as good as translating GOTOs to GOTOS]
-----------------------------------------------------------------------------
Robert Withrow, Tel: +1 617 592 8935, Net: wi...@rwwa.COM
You need to restructure the code.