summaryrefslogtreecommitdiff
path: root/test/files/run/tailcalls.scala
Commit message (Collapse)AuthorAgeFilesLines
* SI-8657 don't miss tailrec defs in more positionsJohannes Rudolph2014-06-251-2/+33
| | | | | | | 1) First operand of boolean expression using `&&` or `||`. Second operands of those boolean exprs were already treated specially here but handling for first operands was missing. 2) Condition of `If`. Also added a test for guards.
* deprecate Pair and TripleDen Shabalin2013-11-201-1/+1
|
* Alter TailRec to have map and flatMapGeorge Leontiev2013-08-241-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As described in the "Stackless Scala with Free Monads" paper scala> import scala.util.control.TailCalls._ import scala.util.control.TailCalls._ scala> :paste // Entering paste mode (ctrl-D to finish) def isEven(xs: List[Int]): TailRec[Boolean] = if (xs.isEmpty) done(true) else tailcall(isOdd(xs.tail)) def isOdd(xs: List[Int]): TailRec[Boolean] = if (xs.isEmpty) done(false) else tailcall(isEven(xs.tail)) // Exiting paste mode, now interpreting. isEven: (xs: List[Int])util.control.TailCalls.TailRec[Boolean] isOdd: (xs: List[Int])util.control.TailCalls.TailRec[Boolean] scala> isEven((1 to 100000).toList).result res0: Boolean = true scala> def fib(n: Int): TailRec[Int] = | if (n < 2) done(n) else for { | x <- tailcall(fib(n - 1)) | y <- tailcall(fib(n - 2)) | } yield (x + y) fib: (n: Int)util.control.TailCalls.TailRec[Int] scala> fib(40).result res1: Int = 102334155
* SI-7479 Make test/files/run/tailcalls.scala pass on AvianSimon Ochsenreither2013-06-101-1/+1
| | | | This commit modifies the test and check file to use the new diff filter.
* Maintenance of Predef.Paul Phillips2013-02-121-9/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Deprecates much of Predef and scala.Console, especially: - the read* methods (see below) - the set{Out,Err,In} methods (see SI-4793) 2) Removed long-deprecated: - Predef#exit - Predef#error should have gone, but could not due to sbt At least the whole source base has now been future-proofed against the eventual removal of Predef#error. The low justification for the read* methods should be readily apparent: they are little used and have no call to be in global namespace, especially given their weird ad hoc semantics and unreasonably tempting names such as readBoolean(). 3) Segregated the deprecated elements in Predef from the part which still thrives. 4) Converted all the standard Predef implicits into implicit classes, value classes where possible: - ArrowAssoc, Ensuring, StringFormat, StringAdd, RichException (value) - SeqCharSequence, ArrayCharSequence (non-value) Non-implicit deprecated stubs prop up the names of the formerly converting methods.
* Begone t1737...Hubert Plociniczak2011-11-021-8/+8
|
* Removing the code which has been deprecated sin...Paul Phillips2011-08-151-1/+1
| | | | | | | Removing the code which has been deprecated since 2.8.0. Contributed by Simon Ochsenreither, although deleting code is such fun one hesitates to call it a contribution. Still, we will. Closes SI-4860, no review.
* Renamed Application to App.Martin Odersky2011-02-211-1/+1
|
* some more performance tunings. No review.Martin Odersky2010-01-181-0/+12
|
* [no content change] Fixed all SVN properties: m...Gilles Dubochet2009-09-241-1/+0
| | | | | | | | [no content change] Fixed all SVN properties: mimes, EOL, executable. Id expansion is consistently enabled for Scala/Java/C# sources in 'src/' and consistently disabled and removed from everywhere else: there should not be any dead Id tags anymore.
* Fixed 1541.Iulian Dragos2008-11-261-0/+11
|
* Fixed tail-call related issues.Iulian Dragos2008-08-081-16/+0
|
* - Improved tail call elimination to handle call...Iulian Dragos2007-10-111-0/+12
| | | | | | | | | - Improved tail call elimination to handle calls on a different instance. - Improved tail calls by skipping trivial arguments (when the argument to the call is the parameter itself) - added preliminary support for incremental DFA.
* updated several tests for MSILmichelou2007-08-171-79/+80
|
* Fixed bug #1205 to optimize even more tail calls.Iulian Dragos2007-07-121-0/+25
|
* Fixed tail call elimination for calls in the rh...Iulian Dragos2007-03-281-0/+3
| | | | | Fixed tail call elimination for calls in the rhs of boolean &&.
* Catch tail calls made from tail boolean or.Iulian Dragos2007-03-191-0/+22
|
* Fixed bug with calls in tail position with fina...Iulian Dragos2006-11-271-0/+39
| | | | | Fixed bug with calls in tail position with final handlers.
* Made some test cases platform-independentmihaylov2006-10-101-1/+1
|
* Moved scala.runtime.compat to scala.compatmihaylov2006-10-081-1/+1
|
* 'test-nsc' has been moved to 'test'.Gilles Dubochet2005-12-161-0/+290
|
* Removed old scala tests from new Scala core mod...Gilles Dubochet2005-12-161-290/+0
| | | | | Removed old scala tests from new Scala core module.
* *** empty log message ***mihaylov2005-10-031-2/+1
|
* Made platform independantmihaylov2005-09-271-11/+10
|
* - Now works with the MSIL backend without modif...mihaylov2004-12-021-1/+0
| | | | | - Now works with the MSIL backend without modifications
* - Import java.lang.System.out and use out inste...mihaylov2004-10-071-9/+10
| | | | | - Import java.lang.System.out and use out instead of System.out
* *** empty log message ***Martin Odersky2004-09-021-1/+1
|
* - imported java.lang.System at the proper placemihaylov2004-04-231-1/+1
|
* - Improved testspaltherr2004-04-101-69/+233
|
* - Added 'import java.lang.System' to satisfy th...mihaylov2004-01-261-0/+1
| | | | | - Added 'import java.lang.System' to satisfy the .NET backend.
* - Added test/files/run/tailcallspaltherr2004-01-261-0/+127