Open sorawee opened 3 months ago
@jpolitz this one's weird -- I think this has to do with the fact that Array
is declared as a newtype
in arrays.arr
, and not really as a data
, and the newtype
declaration doesn't have any way to indicate that it has type arguments? So I'm actually more surprised that the second example does type-check, since I see no reason from the arrays code that it should.
Ugh, Array
. This issue makes me feel that the right solution is probably to deprecate it (and newtype
) and change Array
to a real data
type. That or deprecate the Array
datatype entirely; I think basically all use cases are better served by raw-array
. I think it's basically the only source use of newtype
in the whole runtime library, and no one really uses it other than that. I suppose Array
could allow for []
since it can have methods, but I'm not sure that's a great argument for keeping it.
@sorawee do you mind sharing what you were writing when you found this?
Here's the repaired program written by B Nagy András.
https://code.pyret.org/editor#share=1bVMDO1TN8XX_jlnOIBMeONfMtr-WBg0d&v=0c33ff0
If I'm not mistaken, he is managing https://exercism.org/tracks/pyret, and this is one of the ported problems that he tried out to make sure it's feasible to solve.
EDITED: A couple of other solutions here: https://exercism.org/tracks/pyret/exercises/circular-buffer/solutions
There gotta be a stencil file somewhere, but I couldn't find it.
Ah, his GitHub handler is @BNAndras.
Yup, that’s correct.
fails with
when it's run with the type checker on.
However, this program works fine.
It looks like something's gone wrong with the default namespace?
Originally reported by B Nagy András in Discord.