Project

General

Profile

Bug #1622

BuiltinOneLiners -- less precise location in error messages

Added by John Abbott over 2 years ago. Updated about 1 month ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
enhancing/improving
Target version:
Start date:
18 Oct 2021
Due date:
% Done:

0%

Estimated time:
Spent time:

Description

I have noticed that error messages produced by fns which are defined in BuiltinOneLiners are less precise than those defined in BuiltinFunctions-CoCoALib.
Less precise because they do not indicate which is bad arg; they simply indicate the whole fn call expression.

Can we find a way to make them more precise?


Related issues

Related to CoCoA-5 - Support #1621: Doc for the various BuiltIn filesNew2021-10-18

Related to CoCoALib - Feature #743: Better errors: give supplementary info about the errorIn Progress2015-06-30

History

#1 Updated by John Abbott over 2 years ago

I have set the target version as 5.3.4, but this may be wildly optimistic.
I fear that this request may be rather hard, or even impossible (without making BuiltinOneLiners much more complicated).

#2 Updated by John Abbott over 2 years ago

  • Related to Support #1621: Doc for the various BuiltIn files added

#3 Updated by John Abbott over 2 years ago

Here is an example of what I mean:

/**/ pi := 3.14159;
/**/ CFApprox(pi,2);
--> ERROR: Expecting type RAT, but found type INT
--> CFApprox(pi,2);
-->             ^
/**/ CFApprox(pi,3/2);
--> ERROR: The arg(s) given are unsuitable
--> [CoCoALib] CFApprox: relative error must be between 0 and 1
--> CFApprox(pi,3/2);
--> ^^^^^^^^^^^^^^^^

The 2nd arg must be a rational between 0 and 1. In the first case the troublesome arg is identified; in the second just the whole call is highlighted.

#4 Updated by John Abbott over 2 years ago

  • Subject changed from BuiltinOneLiners to BuiltinOneLiners -- less precise location in error messages

#5 Updated by Anna Maria Bigatti over 2 years ago

I believe that the error must be clear enough in CoCoALib so that there is no need to intercept (all??) situations like this.

#6 Updated by Anna Maria Bigatti over 2 years ago

  • Related to Feature #743: Better errors: give supplementary info about the error added

#7 Updated by John Abbott about 2 years ago

  • Target version changed from CoCoA-5.4.0 to CoCoA-5.4.2

#8 Updated by John Abbott about 1 month ago

  • Target version changed from CoCoA-5.4.2 to CoCoA-5.4.4

Also available in: Atom PDF