Closed flexoron closed 1 year ago
v2.0.11
Because I don't know all about which type identifiers are expected to be processed, I close this issue now.
?- must_be(flix,flux). error(type_error(type,flix),must_be/2). % expected
Look in library/error.pl for the types checked.
On Fri, 19 Aug 2022, 21:42 flexoron, @.***> wrote:
v2.0.11
Because I don't know all about which type identifiers are expected to be processed, I close this issue now.
?- must_be(flix,flux). error(type_error(type,flix),must_be/2). % expected
— Reply to this email directly, view it on GitHub https://github.com/trealla-prolog/trealla/issues/13#issuecomment-1220576383, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFNKSESLJBGFEGFLJFD7533VZ5XKJANCNFSM57AF627Q . You are receiving this because you commented.Message ID: @.***>
error.pl Currently, the following types are supported: boolean,chars, ...
?- must_be(boolean,hmm).
true. % unexpected
?- must_be(chars,hmm).
error(type_error(type,chars),must_be/2). % unexpected
Expecting something like:
?- must_be(character,hmm).
error(type_error(character,hmm),must_be/2). % expected
Trealla doesn't actually use error.pl, it's just there for reference. Must have missed a few.
On Fri, 19 Aug 2022, 22:13 flexoron, @.***> wrote:
Reopened #13 https://github.com/trealla-prolog/trealla/issues/13.
— Reply to this email directly, view it on GitHub https://github.com/trealla-prolog/trealla/issues/13#event-7221755469, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFNKSEUN2B337DORLHWO6DTVZ526XANCNFSM57AF627Q . You are receiving this because you commented.Message ID: @.***>
Please note that chars
is not a type to be reported. In stead, use either list
or character
whichever one is violated.
So, non-characters in a list are not found:
?- must_be(character,1).
error(type_error(character,1),must_be/2).
?- must_be(list,[a,b,1,c]).
true.
?- must_be(chars,[a,b,1,c]). % character-lists are not supported?
error(type_error(chars,[a,b,1,c]),must_be/2). % example (not implemented and not expected)
Sometimes baffling
?- must_be(character, "a").
true.
?- must_be(character, [a]).
error(type_error(character,"a"),must_be/2). % might be reported as ... error(character,[a] ... ?
v2.0.12
?- must_be(chars,a).
true.
?- must_be(chars,abc).
error(type_error(list,abc),must_be/2). % unexpected
?- must_be(chars,"abc").
error(type_error(list,"abc"),must_be/2). % unexpected
?- must_be(chars,[a,b,c]).
error(type_error(list,"abc"),must_be/2). % unexpected
?- must_be(chars,[a,b,1,c]).
error(type_error(list,[a,b,1,c]),must_be/2). % somehow expected, perhaps ...error(character,1)...
v2.0.13
?- must_be(chars,"").
true.
?- must_be(chars,[]).
true.
No character is a character? After all it reads "must be".
Chars means char list. Of which the empty list is an instance.
On Sat, 20 Aug 2022, 09:28 flexoron, @.***> wrote:
v2.0.13
?- must_be(chars,""). true. ?- must_be(chars,[]). true.
No character is a character? After all it reads "must be".
— Reply to this email directly, view it on GitHub https://github.com/trealla-prolog/trealla/issues/13#issuecomment-1221167896, or unsubscribe https://github.com/notifications/unsubscribe-auth/AFNKSEUSCTZ3VSB3WAEL6Y3V2AKDFANCNFSM57AF627Q . You are receiving this because you commented.Message ID: @.***>
In that case the issue can be closed. Thank you very much indeed.
v2.0.10
Ludwig van B's Symphony No. 10 in E♭ major is a hypothetical work (1827) ... In 2019, artificial intelligence technology was used to reconstruct ... (wikipedia). Not all hope is lost.