brownplt / code.pyret.org

Website for serving Pyret to folks.
Other
24 stars 45 forks source link

difference in presentation of incomparability error #484

Open shriram opened 1 year ago

shriram commented 1 year ago

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. (-:

blerner commented 1 year ago

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.

shriram commented 1 year ago

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

blerner commented 1 year ago

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.

shriram commented 1 year ago

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

blerner commented 1 year ago

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

jpolitz commented 1 year ago

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