pyret-lang
pyret-lang copied to clipboard
matching text in `raises`
Suppose I have the program:
type Integer = Number%(num-is-integer)
fun f(n :: Integer):
n
end
I can write
check:
f(0.5) raises "predicate"
f(0.5) raises "num-is-integer"
end
but I can't match against the whole text:
f(0.5) raises "predicate num-is-integer"
presumably because of the text formatting:

Since we're matching against plain strings, should the text be stripped of formatting to enable such matches?
Curiously, the space lies in a DMZ, because both these fail:
f(0.5) raises "predicate "
f(0.5) raises " num-is-integer"
It's worse than that, actually. I'm pretty sure raises matches against the to-string output of your error, which is the console text rendering, not the rich HTML rendering. I've been annoyed by this for a while, and haven't figured out a suitable repair... :-\