Type error "evaluable": non-compliant exception
pmoura opened this issue · 2 comments
Several standard compliance tests fail due to non-compliant exception for "evaluable" type errors. For example:
! lgt_acos_1_05: failure
! test goal throws the wrong error:
! expected error(type_error(evaluable,foo/0),A)
! but got error(type_error(evaluable,acos(foo)),'arithmetic:is'/2-2)
! in file /Users/pmoura/logtalk/tests/prolog/functions/acos_1/tests.lgt between lines 54-58
This may be an easy fix. In the place where the exception is thrown, replace the second argument in the type_error/2
term by the non-evaluable term indicator.
It seems that there are at least two bugs: acos
is not supported and the type error format is wrong. I've checked the 1995 standard document and acos
is not included. Do you have any reference to a complete list of the functions that are expected to be supported? Thanks!
Some of the arithmetic functions I mention here and in other issues are de facto standard instead of official ISO standard. See e.g. the table at http://www.gprolog.org/manual/gprolog.html#sec96
See also the tests at https://github.com/LogtalkDotOrg/logtalk3/tree/master/tests/prolog/functions