This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from Razvan Cojocaru [email protected] | |
to [email protected] | |
date Tue, Sep 13, 2011 at 11:07 AM | |
subject [scala-user] unexpected REPL equals | |
The REPL unexpectedly calls equals with a String - this behavior is new in 2.9.1. – in the code below, I know the equals sucks but is short and used to work since 2.8 | |
What to do? What to do? | |
$ scala |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- | |
- &CENTER { x: 1, y: 2 } | |
- &LEFT { x: 0, y: 2 } | |
- &BIG { r: 10 } | |
- &SMALL { r: 1 } | |
# All the following maps are equal: | |
- # Explicit keys | |
x: 1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
% scala | |
Welcome to Scala version 2.10.0.r25823-b20111011192940 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_26). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> class Bippy extends java.util.Collection[Int] | |
<console>:7: error: class Bippy is missing 13 methods: | |
As seen from class Bippy, the missing method signatures are as follows. | |
(For convenience, these are usable as stub implementations.) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> inspectr package | |
[info] compile:package = Task[java.io.File] | |
[info] +-compile:package-bin = Task[java.io.File] | |
[info] +-compile:package-configuration(for package-bin) = Task[sbt.Package$Configuration] | |
[info] | +-compile:mappings(for package-bin) = Task[scala.collection.Seq[scala.Tuple2[java.i.. | |
[info] | | +-compile:products = Task[scala.collection.Seq[java.io.File]] | |
[info] | | | |
[info] | +-compile:artifact-path(for package-bin) = target/scala-2.10.0-SNAPSHOT/scala-impro.. | |
[info] | | +-*:cross-target = target/scala-2.10.0-SNAPSHOT | |
[info] | | +-*/*:artifact-name = <function3> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[user] | |
name = Paul Phillips | |
email = [email protected] | |
[github] | |
user = $GITHUB_USER | |
token = $GITHUB_TOKEN | |
[clean] | |
requireForce = false | |
[grep] | |
lineNumber = true |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
java | |
-XX:+CMSClassUnloadingEnabled | |
-XX:MaxPermSize=384m | |
-XX:ReservedCodeCacheSize=128m | |
-Xmx1536m | |
-Xms1536m | |
-Xmx3g | |
-Xms3g | |
-Xms1536m | |
-Xmx1536m |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
# ^-- don't assume bash is in /bin | |
# we need a git library of stuff like this, since there are lots | |
# of ways to get it subtly wrong | |
git_branch_exists () { | |
git show-ref --verify --quiet refs/heads/$1 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class A { | |
def f[T, U, CC[_]](x: CC[T], y: U)(implicit o: U) = x | |
f(List("a"), (x: String) => x.toSeq) | |
} | |
[paulp@stem ~ (master)]$ scalac3 -Dscalac.debug.tvar ./a.scala | |
[ create] ?T ( In A#f[T,U,CC[_]] ) | |
[ create] ?U ( In A#f[T,U,CC[_]] ) | |
[ create] ?CC ( In A#f[T,U,CC[_]] ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// a.scala | |
// Fri Jan 27 08:21:56 PST 2012 | |
class ModuleID(val organization: String, val name: String, val revision: String) | |
trait ProviderCreation { | |
def fromUrls(urls: Seq[URL]): MultiProvider | |
def fromUrl(url: URL): UrlProvider | |
def fromPath(path: PathType): SinglePathProvider | |
def fromClassPath(classPath: String): ClassPathProvider |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def initializeFromClassRep(owner: Symbol, classRep: ClassRep) { | |
val useSource = classRep match { | |
case DualClassRep(_, _) => platform needCompile classRep | |
case SourceRep(_) => true | |
case BinaryRep(_) => false | |
case _ => println("nothing") ; return | |
} | |
vinform("[%s] %s %s".format( | |
if (useSource) "src" else "bin", owner, classRep)) |