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
Extending Range class to Interval Arithmetic #392
Comments
I make the claim that these Here is the initial code prototype from the newly minted raku Math::Interval module:
As you can see, even this partial implementation steps into a world where division is not as simple as dividing each endpoint by a scalar. This is what I mean when I say that we would be stepping into the (often arcane) Interval Arithmetic arena. The need for non-obvious manipulations like this means that you will need to be well informed by the docs what and why this is going on in your language. In fact to do this properly would return a disjoint multi-interval instead of the 'spans 0' error mode. It has occurred to me that a Junction of Ranges would maybe be a nice solution for this - but again, more weirdness on the horizon for the typical coder. While some languages (notably Julia) DO support Interval Arithmetic deeply, I think raku devs should be wary of the resource and time implications of a fully functional deep implementation. Therefore there is a risk that a shallow partial implementation in core will be seen as a weakness of the core language. Better to be in module space where the module can evolve incrementally and does not risk the reputation of the core language. |
thanks for the fb - guess there are no detractors |
There is a proposal from @vrurg to add
Range op Range
overrides where op is+-*/
in Issue #391This Issue is to debate the pros and cons of extending the raku language to include these operations (including extensions to ROAST and docs).
[NB. In my opinion, we should NOT extend the raku language in this way and I will be making the case AGAINST and to keep these extensions in module space.]
Here is my understanding of the current design of class Range:
Range op Scalar
andScalar op Range
operations are provided today for the purpose of Shifting and Scaling intervalsThe text was updated successfully, but these errors were encountered: