Issue 596 - Under Scala 2.8.0 snippets get instantiated multiple times
Updated 1 year, 6 months ago
| Derek Chen-Becker | Reviewers | ||
| 596 | dchenbecker, dpp, marius, charles, heiko, joni, atsuhiko, jorge, naftoli, kris, indrajit, alexb, dlouwers, mstarzyk, rmellgren, jhoffman, probinett, jmadsen, mhartmann, jstrachan, jgoday | ||
| None | LiftWeb-archive | ||
Changes to Scala's non-strict "projection" (deprecated) and "views" (new) methods on Seq make it non-lazy, so now the ListHelpers.first method calls the "_f" function on elements in the Seq multiple times. The effect was noticed when snippet classes were instantiated multiple times. Per advice on the Scala mailing list, the method has been changed to use toStream instead of projection.
On my local Lift test app.
It's kinda funny how first() morphed from my imperative code into functional code that now breaks. I'm half tempted to put the imperative code back. As a broader issue, can you find any other places in the code where we're using the buggy projection stuff and make it work right?
