You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'd like to shift some more predicates into patterns, so that I can avoid a bunch of code that looks like (when (foo-p bar) (trivia.next:next)). But, so far, Trivia seems to consider the use of predicates that don't correspond to types deserving of a full warning.
A little example is:
CL-USER> (trivia:match 2
((satisfiesevenp) 'even))
WARNING: failed to infer the type from test (EVENP ?) !
WARNING: failed to infer the type from test (EVENP ?) !
WARNING: failed to infer the type from test (EVENP ?) !
EVEN
There isn't a type that corresponds to the set of values which satisfy evenp, so I am not sure what I can do to avoid the warning. The same also happens with guard1:
CL-USER> (trivia:defpattern even-number ()
`(trivia:guard1 (x) (evenp x)))
#<FUNCTION 'EVEN-NUMBER {52E5A57B}>
CL-USER> (trivia:match 2
((even-number) 'even))
WARNING: failed to infer the type from test (EVENP ?) !
WARNING: failed to infer the type from test (EVENP ?) !
WARNING: failed to infer the type from test (EVENP ?) !
EVEN
(Also, I'd guess the function name for the pattern should just be even-number - sb-int:named-lambda doesn't evaluate the name provided to it.)
Is signalling a full warning intended behaviour for Trivia? Can I write a pattern for some arbitrary test expression which doesn't signal a full warning at compile time? I ask since, in the end, I want to clean up some tests in the rewriter of one-more-re-nightmare, but I want to submit it to Quicklisp, and (to my knowledge) I cannot do so if compilation signals full warnings.
The text was updated successfully, but these errors were encountered:
I'd like to shift some more predicates into patterns, so that I can avoid a bunch of code that looks like
(when (foo-p bar) (trivia.next:next))
. But, so far, Trivia seems to consider the use of predicates that don't correspond to types deserving of a full warning.A little example is:
There isn't a type that corresponds to the set of values which satisfy
evenp
, so I am not sure what I can do to avoid the warning. The same also happens withguard1
:(Also, I'd guess the function name for the pattern should just be
even-number
-sb-int:named-lambda
doesn't evaluate the name provided to it.)Is signalling a full warning intended behaviour for Trivia? Can I write a pattern for some arbitrary test expression which doesn't signal a full warning at compile time? I ask since, in the end, I want to clean up some tests in the rewriter of one-more-re-nightmare, but I want to submit it to Quicklisp, and (to my knowledge) I cannot do so if compilation signals full warnings.
The text was updated successfully, but these errors were encountered: