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
package com.codahale.jerkson.ser | |
import com.fasterxml.jackson.core.JsonGenerator | |
import com.fasterxml.jackson.databind.{SerializerProvider, JsonSerializer} | |
class MapSerializer extends JsonSerializer[collection.Map[_ ,_]] { | |
def serialize(map: collection.Map[_,_], json: JsonGenerator, provider: SerializerProvider) { | |
json.writeStartObject() | |
// attempt #1. doesn't compile, but worked fine in 2.9.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
import scala.reflect.makro.Context | |
object Macros { | |
def trace[A](expr: A) = macro traceImpl[A] | |
def traceImpl[A: c.TypeTag](c: Context)(expr: c.Expr[A]): c.Expr[A] = { | |
import c.universe._ | |
// stand-in for the real type of the traced sub expression. | |
// This lets us conveniently splice this type into the |
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
import Macros._ | |
object Test extends App { | |
val x = 2 | |
trace(2 + x) | |
} |
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
// inner: class B { ... } | |
class B | |
List(constructor B, class B1, class B2, object B3, object B4, object B5, object B6) | |
class B1 | |
actual name = B$B1, javaSimpleName = B1, javaBinaryName = B/B1, javaClassName = B.B1, signature = B$B1 | |
class B2 | |
actual name = B$B2, javaSimpleName = B2, javaBinaryName = B/B2, javaClassName = B.B2, signature = B$B2 | |
object B3 | |
actual name = B$B3$, javaSimpleName = B3$, javaBinaryName = B/B3$, javaClassName = B.B3$, signature = B$B3 | |
object B4 |
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
000051(:swank-rpc (swank:debug-set-break "D:/Dropbox/Scratchpad/Scala/Test.scala" 5) 4) | |
SEND ASYNC REQ: 000051(:swank-rpc (swank:debug-set-break "D:/Dropbox/Scratchpad/Scala/Test.scala" 5) 4) | |
Handling RPC: (swank:debug-set-break D:/Dropbox/Scratchpad/Scala/Test.scala 5) | |
Writing: (:background-message 105 "Location not loaded. Set pending breakpoint.") | |
Writing: (:return (:ok t) 4) | |
RECV: (:background-message 105 "Location not loaded. Set pending breakpoint.")SEND ASYNC RESP: [:background-message, 105, u'Location not loaded. Set pending breakpoint.'][:background-message, 105, u'Location not loaded. Set pending breakpoint.'] | |
RECV: (:return (:ok t) 4)SEND ASYNC RESP: [:return, [:ok, True], 4][:return, [:ok, True], 4] | |
request #4 took 0.0699999332428 secondswarning: no handler registered for message #4 with payload True | |
ensime>(swank:debug-list-breakpoints) |
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
myke compile C:\Projects\Kepler_Good\sandbox\Test.scala -Xprint:refchecks,uncurry | |
git: branch = ticket/6201, commit = 8ce47873f2 preparations: always explicitly provide type tags (Eugene Burmako, 06.06.2012 14:02:45 +02:00) | |
psi: filename = cmd.exe, arguments = /C c:\PROGRA~1\Java\JDK\bin\java.exe -cp "C:\Projects\Kepler_Good\test\files\codelib\code.jar;C:\Projects\Kepler_Good\lib\jline.jar;C:\Projects\Kepler_Good\lib\fjbg.jar;C:\Projects\Kepler_Good\build\locker\classes\compiler;C:\Projects\Kepler_Good\build\asm\classes;C:\Projects\Kepler_Good\build\libs\forkjoin.jar;C:\Projects\Kepler_Good\build\locker\classes\reflect;C:\Projects\Kepler_Good\build\locker\classes\library" -Dscala.usejavacp=true -Dscala.repl.vids=1 -Dscala.repl.autoruncode=C:\Users\xeno.by/.scala_autorun -Dscala.repl.maxprintstring=0 scala.tools.nsc.Main -language:experimental.macros -Xprint:refchecks,uncurry Test.scala, home = C:\Projects\Kepler_Good\sandbox | |
[[syntax trees at end of refchecks]] // Test.scala | |
package <empty> { |
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 Test { | |
class Foo1 { | |
def must(x: scala.xml.Elem) = () | |
} | |
class Foo2 { | |
def must(x: Int) = () | |
} | |
implicit def toFoo1(s: scala.xml.Elem) = new Foo1() | |
implicit def toFoo2(s: scala.xml.Elem) = new Foo2() |
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
# courtesy of: https://gist.github.com/1251716 | |
# saved from: http://pastie.org/private/bclbdgxzbkb1gs2jfqzehg | |
import sublime | |
import sublime_plugin | |
import subprocess | |
class MyFilterCommand(sublime_plugin.TextCommand): | |
""" | |
Runs an external command with the selected text, |
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
import annotation.tailrec | |
import scala.math.{min, max} | |
import scala.{specialized => spec} | |
import language.experimental.macros | |
import scala.reflect.{ClassTag, TypeTag} | |
import scala.reflect.macros.Context | |
object Macros { |
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
import Flags._ | |
import base.Attachments | |
import scala.annotation.tailrec | |
trait Symbols extends api.Symbols { self: SymbolTable => | |
import definitions._ | |
import SymbolsStats._ | |
protected var ids = 0 |