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
view gaps #4332
Comments
Imported From: https://issues.scala-lang.org/browse/SI-4332?orig=1 |
@adriaanm said: |
@paulp said: |
Kieron Wilkinson (kieron) said: scala> (1 to Int.MaxValue).view.filter(_ % 2 == 0).takeWhile(_ < 10) Are improving the views not too much of a priority at the moment? I have been playing with views to show at some tutorial sessions at my company to teach functional programming (e.g. creating a set of natural numbers to use in computations). I'd rather use views because I don't care to cache intermediate values, like I understand Stream to do - I'm not really selling functional programming by creating large intermediate collections around :) I guess I should just avoid them, because I don't want it to blow up during a demo :) but I thought I would check in to see if there is a plan for these, or maybe I could look into it myself if any patches I might submit are likely to get accepted some time soon? Thanks! |
Nikolay Artamonov (nartamonov) said: scala> util.Properties.versionString scala> Seq(1,2,3,4).view(1,3).slice(0,1)
... skipped ... |
@SethTisue said:
|
@adriaanm said: |
@Ichoran said:
|
@paulp said: |
@vigdorchik said (edited on May 8, 2013 12:19:34 PM UTC): |
@paulp said: |
@vigdorchik said: |
@paulp said: Here's some code I found, dated 2 years 1 month ago. I stress that this isn't necessarily what I would expect to go with; there are a number of plausible approaches. |
Edmondo Porcu (edmondo1984) said: I wonder if it would not be safer for the community to deprecate or remove views and favour iterator style in one of the next releases. This is a small non breaking change that will immediately force user to run away from views. |
@adriaanm said: |
@retronym said: |
@retronym said: |
views are completely reimplemented in the 2.13 collections on a sounder basis and should work now (as of 2.13.0-M4) |
These are particularly bad because they are runtime failures with no obvious way to know what will fail. Example.
It would make a lot more sense to me if views implemented an abstract interface (and thus the compiler would tell us what methods aren't covered) than having them override all kinds of inherited implementations, with runtime failure for methods which are missed or otherwise elude the concrete barriers.
(Get it, concrete barriers? That is gold.)
The text was updated successfully, but these errors were encountered: