summaryrefslogtreecommitdiff
path: root/src/library
Commit message (Collapse)AuthorAgeFilesLines
* Merge remote-tracking branch 'origin/2.10.x' into merge/2.10.x-to-master-2Jason Zaugg2013-09-271-7/+4
|\ | | | | | | | | | | | | | | | | | | Conflicts: bincompat-backward.whitelist.conf bincompat-forward.whitelist.conf build.xml src/compiler/scala/tools/nsc/typechecker/RefChecks.scala src/library/scala/concurrent/Future.scala src/reflect/scala/reflect/internal/Types.scala
| * SI-7861 Don't execute internal callbacks on the user ExecutorJason Zaugg2013-09-211-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Callbacks internal to the implementation of Futures should be executed with the `InternalCallbackExecutor`, rather than the user supplied `Executor`. In a refactoring da54f34a6, `recoverWith` and `flatMap` no longer played by these rules. This was noticed by a persnickety test in Play. Before this patch, the enclosed test outputs: % scala-hash v2.10.3-RC2 test/files/run/future-flatmap-exec-count.scala mapping execute() flatmapping execute() execute() recovering execute() execute()
* | Remove octal escape literals from the codebaseSimon Schaefer2013-09-251-22/+22
| | | | | | | | | | Octal escape literals are deprecated and will be removed in the next Scala version.
* | Merge pull request #2938 from Ichoran/issue/7725Jason Zaugg2013-09-231-3/+26
|\ \ | | | | | | SI-7725 - Vector concatenation is unreasonably slow
| * | SI-7725 - Vector concatenation is unreasonably slowRex Kerr2013-09-201-3/+26
| | | | | | | | | | | | | | | | | | | | | | | | Rewrote ++ to use append or prepend when adding small collections to the end or beginning of vectors. This solves the extra-O(n) problem for addition of single elements reported in SI_7725. Renamed LgConcatFaster to Log2ConcatFaster (more widely recognizable).
* | | Merge pull request #2953 from jiaweihli/masterJason Zaugg2013-09-231-1/+1
|\ \ \ | | | | | | | | Fix typo in documentation.
| * | | Fix typo in documentation.Jiawei Li2013-09-161-1/+1
| | | |
* | | | Convenience methods from Try[T] => {Future, Promise}[T]Jason Zaugg2013-09-192-2/+16
| |/ / |/| |
* | | Cull extraneous whitespace.Paul Phillips2013-09-1870-515/+100
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One last flurry with the broom before I leave you slobs to code in your own filth. Eliminated all the trailing whitespace I could manage, with special prejudice reserved for the test cases which depended on the preservation of trailing whitespace. Was reminded I cannot figure out how to eliminate the trailing space on the "scala> " prompt in repl transcripts. At least reduced the number of such empty prompts by trimming transcript code on the way in. Routed ConsoleReporter's "printMessage" through a trailing whitespace stripping method which might help futureproof against the future of whitespace diseases. Deleted the up-to-40 lines of trailing whitespace found in various library files. It seems like only yesterday we performed whitespace surgery on the whole repo. Clearly it doesn't stick very well. I suggest it would work better to enforce a few requirements on the way in.
* | | SI-7841 Remove AnyRef specialization from AbstractPartialFunctionJason Zaugg2013-09-161-1/+13
| | | | | | | | | | | | | | | | | | | | | | | | This was missed in cc3badae1 Compatibility classes for formerly specialized variants used by Scalacheck have been added as a stopgap measure until we publish the next milestone.
* | | SI-7841 Remove commented out AnyRef specialization from Function{0,1}.Jason Zaugg2013-09-153-3/+3
|/ / | | | | | | In a sign of decreased optimism about that facility.
* | Merge remote-tracking branch 'origin/master' into merge/2.10.x-to-masterJason Zaugg2013-09-112-24/+49
|\ \ | | | | | | | | | | | | Conflicts: src/compiler/scala/tools/nsc/ast/parser/Parsers.scala
| * \ Merge pull request #2927 from Ichoran/issue/7708Grzegorz Kossakowski2013-09-111-10/+17
| |\ \ | | | | | | | | SI-7708 - Improve Bitset foreach performance
| | * | SI-7708 - Improve Bitset foreach performanceRex Kerr2013-09-091-10/+17
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Switched inner for loop for a while loop to enable early exit when bitset is sparse. 2. Switched outer for loop for while loop for performance. 3. Changed WordLength and friends to final for performance. New version runs in 60% of time of old on dense bitsets, faster if highly sparse. No tests committed (requires performance testing framework).
| * | | SI-7356 - Source.mkString performs painfully slow (...)Rex Kerr2013-09-101-14/+32
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Wrote a custom mkString for BufferedSource. 2. Moved the logic for rescuing the iterator-buffered char out of BufferedLineIterator and into a private method in BufferedSource. Speed test based on the one in the issue tracker (but written correctly) indicates that performance is equal or better to getLines. This resolves SI-7356 in a minimal fashion.
* | | Merge remote-tracking branch 'origin/2.10.x' into merge/2.10.x-to-masterJason Zaugg2013-09-103-38/+36
|\ \ \ | |/ / |/| / | |/ | | Conflicts: src/compiler/scala/tools/nsc/transform/ExtensionMethods.scala
| * Merge pull request #2866 from retronym/ticket/7269Jason Zaugg2013-09-092-3/+5
| |\ | | | | | | SI-7269 Rework MapLike#retains to account for desugaring change
| | * SI-7269 Rework MapLike#retains to account for desugaring changeJason Zaugg2013-08-292-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `MapLike#retains` contains a for-comprehension that relied on the strict `filter` by its generator. You can't, in general, iterate a mutable map and remove items in the same pass. Here's the history of the desugaring of: def retain[A, B](thiz: mutable.Map[A, B])(p: (A, B) => Boolean): thiz.type = { thiz.foreach { case (k, v) => if (p(k, v)) thiz -= k } Before regression (c82ecabad6~1): thiz.filter(((check$ifrefutable$1) => check$ifrefutable$1: @scala.unchecked match { case scala.Tuple2((k @ _), (v @ _)) => true case _ => false })).withFilter(((x$1) => x$1: @scala.unchecked match { case scala.Tuple2((k @ _), (v @ _)) => p(k, v).unary_$bang })).foreach(((x$2) => x$2: @scala.unchecked match { case scala.Tuple2((k @ _), (v @ _)) => thiz.$minus$eq(k) })); After regression (c82ecabad6, which incorrectly assumed in the parser that no filter is required for isInstanceOf[Tuple2]) thiz.withFilter(((x$1) => x$1: @scala.unchecked match { case scala.Tuple2((k @ _), (v @ _)) => p(k, v).unary_$bang })).foreach(((x$2) => x$2: @scala.unchecked match { case scala.Tuple2((k @ _), (v @ _)) => thiz.$minus$eq(k) })); After the reversion of c82ecabad6, v2.10.2 This is also after 365bb2b4e, which uses `withFilter` rather than `filter`. thiz.withFilter(((check$q$1) => check$ifrefutable$1: @scala.unchecked match { case scala.Tuple2((k @ _), (v @ _)) => true case _ => false })).withFilter(((x$1) => x$1: @scala.unchecked match { case scala.Tuple2((k @ _), (v @ _)) => p(k, v).unary_$bang })).foreach(((x$2) => x$2: @scala.unchecked match { case scala.Tuple2((k @ _), (v @ _)) => thiz.$minus$eq(k) })); This commit does the same as `SetLike#retains`, and converts the map to an immutable list before the rest of the operation.
| * | SI-7814 Updates the instrumented version of ScalaRuntime.Jason Zaugg2013-09-051-24/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some tests for specialization use a modified version of the standard library that count boxing, array lookups etc. These sources are updated manually with the script: % test/instrumented/mkinstrumented.sh build Looks that that wasn't done for a while, though. This commit brings it up to date, and adjusts a few braces in ScalaRuntime.scala so the patch srt.scala (used by that script) is shorter. We should really avoid checking in the products of that script and run it as part of the build, or, better, use the bytecode instrumentation framework instead of a modified standard library. But I have to leave that for another day.
| * | SI-7814 Avoid init cycle between Predef, `package`, ScalaRuntimeJason Zaugg2013-09-051-11/+3
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Not every application will force these in a single thread; we have to do our best to avoid cycles between them. The enclosed test was failing every time before the change. This commit breaks the cycle by avoiding computing `tupleNames` in the constructor of `ScalaRuntime`. The new version has the added benefit of including specialized tuple subclasses, which is verified with a unit test for `isTuple`. Are there more of these lurking? It seems likely. I'm more than a little concerned about the way the `ControlThrowable` fires up `scala.SystemProperties` to check whether or not to suppress stack traces; there is already an ugly hack in place: object NoStackTrace { final def noSuppression = _noSuppression // two-stage init to make checkinit happy, // since sys.SystemProperties.noTraceSupression.value // calls back into NoStackTrace.noSuppression final private var _noSuppression = false _noSuppression = sys.SystemProperties.noTraceSupression.value }
* | Merge pull request #2865 from folone/trampolinesGrzegorz Kossakowski2013-09-071-9/+54
|\ \ | | | | | | Alter TailRec to have map and flatMap
| * | Stackless implementation of TailRec in constant memory.Runar Bjarnason2013-08-241-24/+34
| | |
| * | Alter TailRec to have map and flatMapGeorge Leontiev2013-08-241-7/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Correcting scaladoc for all classes defining withDefaultValue method.nermin2013-08-304-4/+4
|/ / | | | | | | The description of the single parameter seems to be a copy and paste mistake from withDefault method.
* | Merge pull request #2867 from mmorearty/patch-1Adriaan Moors2013-08-231-1/+1
|\ \ | | | | | | Fix typo in sample code in scaladoc for package scala.sys.process
| * | Fix typo in sample code in scaladoc for package scala.sys.processMike Morearty2013-08-231-1/+1
| | |
* | | Merge pull request #2858 from Debilski/docstring-fixAdriaan Moors2013-08-231-1/+1
|\ \ \ | |/ / |/| | ProcessBuilder.lines(log) *does* throw an exception.
| * | ProcessBuilder.lines(log) *does* throw an exception.Rike-Benjamin Schuppner2013-08-201-1/+1
| | |
* | | Merge pull request #2810 from xeno-by/topic/compile-time-onlyAdriaan Moors2013-08-211-0/+22
|\ \ \ | |/ / |/| | @compileTimeOnly: moved to scala-library.jar, got some fixes
| * | moves compileTimeOnly to scala-libraryEugene Burmako2013-08-141-0/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is the notion that's come to be universally useful, so I suggest we promote it to be universally accessible. Note that the attached test incorrectly fails to report errors for definitions coming from the empty package and for annotations. These are bugs, and they are fixed in subsequent commits of this pull request.
* | | Add a helper method drop to ScalaRunTime.Paul Phillips2013-08-171-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | We should do a lot more of this - it's ridiculously difficult and error prone to generate code of this kind involving implicits, type inference, etc. where the same goal is trivially accomplished by generating a method call and letting the typer work out the details.
* | | Merge pull request #2803 from adriaanm/rebase-2728Adriaan Moors2013-08-161-18/+16
|\ \ \ | | | | | | | | SI-7658 Prevent StackOverflowError in ScalaRunTime.stringOf
| * | | Remove unused private[scala] def ScalaRunTime.checkZipSimon Ochsenreither2013-08-081-14/+0
| | | |
| * | | SI-7658 Prevent StackOverflowError in ScalaRunTime.stringOfSimon Ochsenreither2013-08-081-4/+16
| |/ /
* | | Merge pull request #2798 from som-snytt/issue/7544-errmsgAdriaan Moors2013-08-161-1/+2
|\ \ \ | | | | | | | | SI-7544 Interpolation message for %% literal
| * | | StringContext#checkLengths reports bad args countSom Snytt2013-08-061-1/+2
| |/ / | | | | | | | | | | | | | | | Since interpolator args are of type Any, it's easy to write s(args) instead of s(args: _*). I wonder if Xlint would have warned me about that.
* | | Merge pull request #2831 from soc/SI-7624Grzegorz Kossakowski2013-08-1510-1762/+625
|\ \ \ | | | | | | | | SI-7624 Fix -feature and some -Xlint warnings
| * | | SI-7624 Fix -Xlint warnings in AnyVal-related codeSimon Ochsenreither2013-08-159-1762/+624
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The changes are actually pretty small: scala.language.implicitConversions is moved around so that it is only emitted to the source file if there is an actual implicit conversion. The rest of the diff are mostly the new generated source files reflecting that change.
| * | | SI-7624 Fix -feature warnings and build with -featureSimon Ochsenreither2013-08-151-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I added a language.existential import to LazyCombiner.scala which should not be necessary, but causes a spurious warning otherwise: scala/src/library/scala/collection/parallel/mutable/LazyCombiner.scala:33: warning: the existential type scala.collection.parallel.mutable.LazyCombiner[_$1,_$2,_$3] forSome { type _$1; type _$2; type _$3 <: scala.collection.generic.Growable[_$1] with scala.collection.generic.Sizing }, which cannot be expressed by wildcards, should be enabled by making the implicit value scala.language.existentials visible. if (other.isInstanceOf[LazyCombiner[_, _, _]]) { ^ I created ticket SI-7750 to track this issue.
* | | | Merge pull request #2819 from som-snytt/issue/regextract-charAdriaan Moors2013-08-141-0/+38
|\ \ \ \ | | | | | | | | | | SI-7737 Regex matches Char
| * | | | SI-7737 Regex matches CharSom Snytt2013-08-101-0/+38
| | |/ / | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Enables Char extraction by regex. ``` val r = """(\p{Lower})""".r "cat"(0) match { case r(x) => true } val nc = """\p{Lower}""".r "cat"(0) match { case nc() => true } ```
* | | | Merge pull request #2791 from som-snytt/issue/7265-2.11Adriaan Moors2013-08-141-4/+3
|\ \ \ \ | | | | | | | | | | SI-7265 javaSpecVersion, adjust isJava... tests for 2.11
| * | | | SI-7265 javaSpecVersion, adjust isJava... testsSom Snytt2013-08-011-4/+3
| |/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make this and related properties public, because they are useful. This change ought to have been committed at 2.11 and then backported with restrictions, rather than vice-versa. Note that they are defined in the order, version, vendor and name, which is the order from the underlying javadoc. It would be a neat feature of the PR validator, as previously imagined, to run a "pending" test and then, on success and merge, to move it automatically to the canonical suite.
* | | | Merge pull request #2780 from lcycon/lcycon-deprecate_lockAdriaan Moors2013-08-141-0/+1
|\ \ \ \ | |_|/ / |/| | | Add deprecation warning to scala.concurrent.Lock class
| * | | Add deprecation warning to lock classLuke Cycon2013-07-291-0/+1
| | | |
* | | | Make map2Conserve occupy constant stack space in spirit of SI-2411George Leontiev2013-08-081-0/+2
| |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | I recently discovered a StackOverflowError, caused by this function: https://gist.github.com/folone/7b2f2e2a16314ab28109 The circumstances are pretty extreme, still having a tail-recursive function seems to be a good idea. The function behaves the same way old function did (supported by tests), which is not really how map2 behaves. I did not change this behavior to not introduce any regression. I actually tried to make it behave like map2, and it does introduce regression.
* | | Merge remote-tracking branch 'scala/2.10.x' into merge-2.10.xGrzegorz Kossakowski2013-07-293-33/+221
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: bincompat-backward.whitelist.conf bincompat-forward.whitelist.conf src/compiler/scala/reflect/reify/phases/Reshape.scala src/compiler/scala/tools/nsc/symtab/classfile/ClassfileParser.scala src/compiler/scala/tools/nsc/transform/Mixin.scala src/compiler/scala/tools/nsc/typechecker/RefChecks.scala src/compiler/scala/tools/nsc/typechecker/Typers.scala src/library/scala/concurrent/impl/Promise.scala src/reflect/scala/reflect/internal/StdAttachments.scala test/files/neg/macro-override-macro-overrides-abstract-method-b.check test/files/run/t7569.check
| * | Merge pull request #2674 from richdougherty/2.10.x-si7336-try2Adriaan Moors2013-07-122-24/+197
| |\ \ | | | | | | | | SI-7336 Link flatMapped promises to avoid memory leaks
| | * | SI-7336 - Link flatMapped promises to avoid memory leaksRich Dougherty2013-07-062-24/+197
| | | |
| * | | Merge pull request #2666 from som-snytt/issue/7265-spec-at-leastAdriaan Moors2013-07-121-10/+25
| |\ \ \ | | | | | | | | | | SI-7265 General test for spec version