Skip to content

Instantly share code, notes, and snippets.

View paulp's full-sized avatar
🤫

Paul Phillips paulp

🤫
  • CAZ, Inc.
  • Cascadia Autonomous Zone
View GitHub Profile
from Razvan Cojocaru pub@razie.com
to scala-user@googlegroups.com
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
---
- &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
% 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.)
> 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>
@paulp
paulp / .gitconfig
Created December 1, 2011 00:12
my gitconfig
[user]
name = Paul Phillips
email = paulp@improving.org
[github]
user = $GITHUB_USER
token = $GITHUB_TOKEN
[clean]
requireForce = false
[grep]
lineNumber = true
java
-XX:+CMSClassUnloadingEnabled
-XX:MaxPermSize=384m
-XX:ReservedCodeCacheSize=128m
-Xmx1536m
-Xms1536m
-Xmx3g
-Xms3g
-Xms1536m
-Xmx1536m
@paulp
paulp / scala-merge-integration.sh
Created December 6, 2011 21:42 — forked from jsuereth/scala-merge-integration.sh
Merge script to make sure develop commits actually build before pushing to master.
#!/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
}
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[_]] )
// 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
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))