Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

difference in presentation of incomparability error #484

Open
shriram opened this issue Sep 18, 2023 · 6 comments
Open

difference in presentation of incomparability error #484

shriram opened this issue Sep 18, 2023 · 6 comments

Comments

@shriram
Copy link
Member

shriram commented Sep 18, 2023

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
Copy link
Member

blerner commented Sep 19, 2023

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
Copy link
Member Author

shriram commented Sep 19, 2023

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

@blerner
Copy link
Member

blerner commented Sep 19, 2023

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
Copy link
Member Author

shriram commented Sep 19, 2023

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

@blerner
Copy link
Member

blerner commented Sep 19, 2023

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
Copy link
Member

jpolitz commented Sep 19, 2023

Oh, this isn't on pyret-lang, guess I referenced the wrong issue. brownplt/pyret-lang@4437c20

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants