Skip to content

Why does a type check of an unknown type not produce an error? #203

Closed Answered by pmoura
schwidom asked this question in Q&A
Discussion options

You must be logged in to vote

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).

Replies: 1 comment 3 replies

Comment options

You must be logged in to vote
3 replies
@schwidom
Comment options

@schwidom
Comment options

@pmoura
Comment options

Answer selected by schwidom
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants