-
When I accidentially misspelled a type, it just fails. I think it would be better to have an error.
Thanks in Advance, |
Beta Was this translation helpful? Give feedback.
Answered by
pmoura
Apr 15, 2024
Replies: 1 comment 3 replies
-
Main reason: performance. Note that the
|
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
See the
type
object implementation of the type-checking predicates. The main type-checking predicate,check/2
, is declared multifile:https://logtalk.org/manuals/libraries/types.html#defining-new-types
To throw an error on a unknown type would require a defaulty representation and thus the use of cuts, resulting in a performance penalty when calling the type-checking predicates (each call would result in the creation of a choice-point, followed by its destruction).