Bug #928
ciao, exit, quit can be used not only at top level
Description
The manual for ciao/exit/quit says the command can be used only at top level. This is apparently not true.
define f(n) if n > 1 then ciao endif enddefine f(1); --> does nothing f(2); --> exits CoCoA-5
The simplest solution is just to remove "only at top level" from the manual.
What is the right solution?
Related issues
History
#1 Updated by John Abbott almost 8 years ago
- Related to Feature #927: Add "exit" in addition to "ciao" added
#2 Updated by John Abbott almost 8 years ago
Marked as low priority as it probably affects no-one (unless someone is looking for trouble by putting ciao/exit/quit
inside a function).
I'm not even sure how useful it is to allow a command such as
if n > 1 then exit endif
Just because I cannot see a use for it does not mean that there is no (good) use. Maybe it is just enough to remove the comment from the manual?
#3 Updated by John Abbott over 2 years ago
The problem as describe is still present.
The easy approach is to leave the interpreter as is, and just change the documentation.
However, the risk is that a "malicious" person could write a write a function which callsciao
(under certain circumstances). If that happens then the user loses all results
computed inside CoCoA-5.
My current though is to allow a limited a mount of time to see whether we can restrict
use of ciao
(and exit
) just to top level. If it is easy to change the interpreter (ha!)
then we can make the change; otherwise we leaving things as they are.
Could there really be a reasonable use-case for permitting ciao
inside a function?