Re: bug in 8.4.14 return -code error?



Andreas Leitgeb wrote:
Bryan Oakley <oakley@xxxxxxxxxxxxxxxxxxxx> wrote:
Don Porter wrote:
Bryan Oakley wrote:
I'm seeing what looks like buggy behavior with "return -code error" in 8.4.14.
Is it at odds with any documentation?
Yes. return -code error doesn't behave according to the documentation IMO.

I don't think it's a bug.

[return -code error] is designed to make the *current procedure*
behave like the command "error", not to be equivalent to [error]
itself.

catch {return -code error} is 2(return) , not 1(error)


Hmmm. I guess I see the point, though it still seems non-intuitive. If catch catches "return -code error -errorcode foo", I would expect to be able to retrieve the errorcode I specified. Apparently not, though the documentation doesn't seem to give a hint about that.


I guess this means that 8.5 has a regression in this regard, then.


--
Bryan Oakley
www.tclscripting.com
.



Relevant Pages

  • Re: system() in the absence of a command processor
    ... whether your code above would invoke undefined behavior or not. ... some documentation for how systemwill behave. ... The behaviour is only undefined if this documentation states the ... even reasonable that implementation-specific documentation for system ...
    (comp.lang.c)
  • Re: circular require
    ... But instead of reading and trying to understand what others have ... posted he keeps complaining about require being broken. ... anything in the documentation of require that doesn't behave as ...
    (comp.lang.ruby)
  • Re: Comparing float and decimal
    ... I was thinking more of a single-line warning in the set documentation ... to the effect that funny things happen in the absence of transitivity ... having some floats behave one way and some behave ... I think having decimals play nicely with integers ...
    (comp.lang.python)
  • Re: Where is "split on ." documented?
    ... [This followup was posted to comp.lang.perl.misc] ... > I've found that the code fragment ... > doesn't behave as I would expect it. ... > purpose pattern but I cannot find documentation on what it is doing. ...
    (comp.lang.perl.misc)
  • Where is "split on ." documented?
    ... I've found that the code fragment ... doesn't behave as I would expect it. ... gives me a fat 0. ... purpose pattern but I cannot find documentation on what it is doing. ...
    (comp.lang.perl.misc)