brownplt / pyret-lang

The Pyret language.
Other
1.07k stars 110 forks source link

roughnum comparison needs improvement #781

Open shriram opened 8 years ago

shriram commented 8 years ago

If you compare two roughnums for equality, you get a somewhat useful error: it tells you to use within. Unfortunately, because we don't yet have links to function documentation, it's not actually clear how to use within.

I propose that the "More" text for this error give a concrete example. Furthermore, once we add a ternary roughnum comparator (https://github.com/brownplt/pyret-lang/issues/780), the error message should recommend using that operator for equality comparisons and within for testing, and give concrete examples of both.

blerner commented 6 years ago

Can you give a concrete message you'd like to see? My initial attempts at wording such a message choked on my own "too many words!" threshold, so they certainly wouldn't pass yours :)

shriram commented 6 years ago

I don't suppose it's possible to add docs links? That's the real solution to this problem!

blerner commented 6 years ago

That's a non-trivial design problem too. Pyret documentation links aren't stable (especially if we're revising the organization of the docs every so often); there's no representation of links in the error-rendering DSL; there are non-trivial typographic issues too (especially since you probably want to highlight the within code as being the main link text). So my question remains, can you give a concrete message you'd like to see?

shriram commented 6 years ago

I think the error message is fine for now. Let's see if it comes up in a context where it's irksome.

schanzer commented 4 years ago

@shriram @blerner has such a context arisen in the last 2 years?

blerner commented 4 years ago

I would like our errors to be nicer, and to have a good way of linking to docs. I can't spend too much time thinking about this today, but some quick brainstorms: