brownplt / pyret-lang

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

internal error in printing error message #1471

Open shriram opened 5 years ago

shriram commented 5 years ago

This program

https://code.pyret.org/editor#share=1ouED7NupAEhx0qUiaxzB9I5YZ0XZcUZz&v=01bb5ff

followed by this REPL expression

pie-chart(table: label, value
row: ‘EU’, 10.12
row: ‘Asia’, 93.1
row: ‘America’, 56.33
row: ‘Africa’, 101.1
end, _.{title: “A pie chart”})

gives

image

blerner commented 5 years ago

That's an incomplete reporting of the error -- it gave a stack trace, too! @jswrenn the issue for you is the internal error. @sorawee , @schanzer the actual issue for you is in https://code.pyret.org/editor#share=189UgLQQ3Eag5JtrxpBjFzLMS3BO9rA21, according to the trace:

image

sorawee commented 5 years ago

@schanzer and @shriram: you need to decide which version of pie-chart do you want to use. The one from plot library expects the second argument to be a PlotWindowOptions (i.e., a function). The one from Bootstrap: DataScience teachpack expects the second argument to be a string. What happens here is that Shriram uses the teachpack one, but expects the interface of the plot library.

In any case, you should not be using the plot library anymore. It's been deprecated for years. Use chart instead (note that the teachpack does use the chart library).

schanzer commented 5 years ago

Do we have any sense for how many people use the old plot library? Maybe this is crazy, but maybe it makes sense to throw an error message recommending that people shift over to the chart library?

sorawee commented 5 years ago

I've been wanting to kill the deprecated libraries for long time. Just let me know when you reach a conclusion.