Project

General

Profile

Bug #928

ciao, exit, quit can be used not only at top level

Added by John Abbott over 7 years ago. Updated over 2 years ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
Parser/Interpreter
Target version:
Start date:
21 Sep 2016
Due date:
% Done:

0%

Estimated time:
Spent time:

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

Related to CoCoA-5 - Feature #927: Add "exit" in addition to "ciao"Closed2016-09-21

History

#1 Updated by John Abbott over 7 years ago

  • Related to Feature #927: Add "exit" in addition to "ciao" added

#2 Updated by John Abbott over 7 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 calls
ciao (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?

Also available in: Atom PDF