code.pyret.org icon indicating copy to clipboard operation
code.pyret.org copied to clipboard

difference in presentation of incomparability error

Open shriram opened this issue 2 years ago • 6 comments

Program:

fun f1(n :: Number): n + n end
fun f2(n :: Number): 2 * n end

If I write (in either definitions or REPL) f1 < f2 I get a nice colorful error:

image

But if I write f1 == f2 I get the bland:

image

Not sure if this is a CPO issue per se, or something in what Pyret is exposing, but there seem be fewer open issues in this repo. (-:

shriram avatar Sep 18 '23 15:09 shriram

https://github.com/brownplt/pyret-lang/blob/horizon/src/arr/trove/error.arr#L1004-L1019 and https://github.com/brownplt/pyret-lang/blob/horizon/src/arr/trove/error.arr#L2232-L2274 are the relevant messages.

Suggest an alternate wording, and it should be an easy issue for a student to address.

blerner avatar Sep 19 '23 01:09 blerner

The wording is fine, I was more focused on the lack of highlighting.

shriram avatar Sep 19 '23 01:09 shriram

I'm certain you don't mean that -- highlighting is applied to prose text, not to rendered values, so you need to choose what wording you want to surround those rendered values.

blerner avatar Sep 19 '23 01:09 blerner

Why not just the same prose — "The left side … the right side …"?

shriram avatar Sep 19 '23 01:09 shriram

Well...if you look at the second link, it handles general equality-failures, and there's clearly code in there that distinguishes between "The left side...the right side..." wording for certain kinds of values, and the anodyne unhighlighted wording for others. So at some point we had made a deliberate choice to word things this way. I do not remember the reasoning, and this code is ancient (7+ years), and predates @jswrenn's work on error phrasing. So it needs a real looking-over, not just a shrug. :)

blerner avatar Sep 19 '23 01:09 blerner

Oh, this isn't on pyret-lang, guess I referenced the wrong issue. https://github.com/brownplt/pyret-lang/commit/4437c2072662f5a3a7d3a1cdea225613678bde5b

jpolitz avatar Sep 19 '23 19:09 jpolitz