Re: NMinimize problem: fct minimized uses FindRoot
- To: mathgroup at smc.vnet.net
- Subject: [mg123646] Re: NMinimize problem: fct minimized uses FindRoot
- From: "Oleksandr Rasputinov" <oleksandr_rasputinov at hmamail.com>
- Date: Wed, 14 Dec 2011 06:01:21 -0500 (EST)
- Delivered-to: l-mathgroup@mail-archive0.wolfram.com
- References: <201112121143.GAA12817@smc.vnet.net> <jc7asl$p1d$1@smc.vnet.net>
On Tue, 13 Dec 2011 10:54:13 -0000, Oliver Ruebenkoenig <ruebenko at wolfram.com> wrote: > > On Mon, 12 Dec 2011, Oleksandr Rasputinov wrote: > >> For example, the erroneous usage: >> >> Block[{a = 1, b = 2}, Return[a]; Return[b]] > > You can "fix" this by using > > Block[{a = 1, b = 2}, Return[a, Block]; Return[b]] > > but Throw/Catch is probably a better bet. > > Oliver > Interesting; this two-argument form of Return seems like it could be quite useful. However, as far as I can see, this possibility has never been listed on the main page for Return, nor on those for Break or Continue (with which a second argument can also be used), even though it has been allowed since version 4 at the latest. The only documentation that I could find suggesting that it exists at all is for the message (Return::nofunc) that one sees after using it incorrectly. Is this likely to change in future, or has it been left deliberately undocumented to discourage its use?
- Follow-Ups:
- Re: NMinimize problem: fct minimized uses FindRoot
- From: Oliver Ruebenkoenig <ruebenko@wolfram.com>
- Re: NMinimize problem: fct minimized uses FindRoot
- References:
- Re: NMinimize problem: fct minimized uses FindRoot
- From: "Oleksandr Rasputinov" <oleksandr_rasputinov@hmamail.com>
- Re: NMinimize problem: fct minimized uses FindRoot