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
trait Cloneable[+T <: AnyRef] extends AnyRef {
def create(): T
override def clone(): T = create()
}
class A(var a: Int) extends Cloneable[A] {
def create(): A = new A(a)
}
class B(aa: Int, var b: Int) extends A(aa) with Cloneable[B] {
object Wat {
trait TypeSum[T, U] {
type SumType
def add(t: T, u: U): SumType
}
implicit def unitLeft[T]: TypeSum[Unit, T] = new TypeSum[Unit, T] {
type SumType = T
def add(u: Unit, t: T) = t
/* NSC -- new Scala compiler
* Copyright 2005-2010 LAMP/EPFL
* @author Paul Phillips
*/
package scala.tools.nsc
package util
import java.util.concurrent.{ Future, TimeUnit }
import java.lang.reflect.{ Modifier, Field, Method => JMethod }
@paulp
paulp / x.js
Created January 31, 2011 20:03 — forked from tssm0n/x.js
CmdUtils.CreateCommand({
names: ["java"],
arguments: [{role: "object",
nountype: noun_arb_text,
label: "search criteria"}],
icon: "http://www.sun.com/favicon.ico",
preview: "Searches The Java 6 API.",
help: "Enter the name of the Java class or package for which you would like to see the documentation.",
author: {name: "KS", email: "tss@cornbread.com"},
/* sbt -- Simple Build Tool
* Copyright 2011 Mark Harrah
*/
package sbt
import java.io.File
import java.net.URL
import Project.ScopedKey
import complete._
import inc.Analysis
@paulp
paulp / the :: report
Created August 12, 2011 02:10
the phillips commission reports on ::
Searching for changes to scala/collection/immutable/$colon$colon.class ...
Found 80 candidate revisions.
=== r17680 ===
commit e0f5e6e40716fbebee61a88ad998da3aa0eaea22
Author: odersky <odersky@5e8d7ff9-d8ef-0310-90f0-a4852d11357a>
Date: Fri May 8 16:33:15 2009 +0000
massive new collections checkin.
% scala -cp /scala/trunk/build/pack/lib/scala-library.jar scal<tab>
scala. scala.sys.
scala.actors. scala.sys.process.
scala.actors.remote. scala.testing.
scala.actors.scheduler. scala.text.
scala.actors.threadpool. scala.util.
scala.actors.threadpool.helpers. scala.util.automata.
scala.actors.threadpool.locks. scala.util.continuations.
scala.annotation. scala.util.control.
scala.annotation.target. scala.util.grammar.
% scala -cp /scala/trunk/build/pack/lib/scala-library.jar scal<tab>
scala. scala.sys.
scala.actors. scala.sys.process.
scala.actors.remote. scala.testing.
scala.actors.scheduler. scala.text.
scala.actors.threadpool. scala.util.
scala.actors.threadpool.helpers. scala.util.automata.
scala.actors.threadpool.locks. scala.util.continuations.
scala.annotation. scala.util.control.
scala.annotation.target. scala.util.grammar.
[error] x Component manager should
[error] x properly cache a file and then retrieve it to an unresolved component
[error] null (FileChannelImpl.java:1166)
[error] sun.nio.ch.FileChannelImpl$SharedFileLockTable.checkList(FileChannelImpl.java:1166)
[error] sun.nio.ch.FileChannelImpl$SharedFileLockTable.add(FileChannelImpl.java:1068)
[error] sun.nio.ch.FileChannelImpl.tryLock(FileChannelImpl.java:868)
[error] java.nio.channels.FileChannel.tryLock(FileChannel.java:962)
[error] xsbt.boot.Locks$GlobalLock.withChannel$1(Locks.scala:65)
[error] xsbt.boot.Locks$GlobalLock.withChannelRetries$1(Locks.scala:58)
[error] xsbt.boot.Locks$GlobalLock$$anonfun$withFileLock$1.apply(Locks.scala:79)
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