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
<?xml version="1.0" encoding="UTF-8"?> | |
<projectDescription> | |
<name>scala</name> | |
<comment></comment> | |
<projects> | |
</projects> | |
<buildSpec> | |
<buildCommand> | |
<name>org.eclipse.pde.ManifestBuilder</name> | |
<arguments> |
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
@echo off | |
set CLASSPATH="C:\Projects\Kepler\build\locker\classes\compiler;C:\Projects\Kepler\build\locker\classes\library;C:\Projects\Kepler\build\locker\classes\partest" | |
cd /D "%PROJECTS%\Kepler\test" | |
java >con ^ | |
-Xmx1024M >con ^ | |
-Xms64M >con ^ | |
-Dscala.home="C:\Projects\Kepler" >con ^ | |
-Dpartest.javacmd="java" >con ^ | |
-Dpartest.java_options="-Xmx1024M -Xms64M" >con ^ | |
-Dpartest.scalac_options="-deprecation" >con ^ |
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 scala.tools | |
package partest | |
import nsc.io.{ File, Path, Directory } | |
import util.{ PathResolver } | |
import nsc.Properties.{ propOrElse, propOrNone, propOrEmpty } | |
object PartestDefaults { | |
import nsc.Properties._ | |
private def wrapAccessControl[T](body: => Option[T]): Option[T] = |
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
/** This demo shows: | |
* Syntax for quasiquotations | |
* String interpolation as a quasiquote | |
* Code quoting as a quasiquote | |
* Pattern matching against code quotes | |
* Some capabilities of brand new Scala reflection API (typechecking, compiling and running ASTs) | |
*/ | |
>scala -Xquasiquotes -Yquasiquote-debug | |
Welcome to Scala version 2.10.0.dev-1473-ga6c67da (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_25). |
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
Certain types of quasiquotes can have dynamic number of bound varables (example is shown here: | |
https://gist.github.com/1548942, a code pattern with a single splice gets transformed into | |
a pattern with two bound variables), so just requiring a quasiquote provider to expose unapply isn't enough. | |
Having unapplySeq will work, but won't help us with allocating slots for the case of | |
pattern matching used to declare variables: val c"$x + $y" = c"2 + 2". | |
Also, when generating a pattern, quasiquote provider might need to access the guard as well | |
(see https://gist.github.com/1548942 for an example). This doesn't directly fit into the model of | |
macro-driven quasiquote expansion. We either give the q/q provider access to | |
the entire CaseDef (including the body) or hinder it by disallowing to customize guards. |
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
object Test extends App { | |
def foo(bar: Any) = bar | |
val code = foo{ | |
object lazyLib { | |
def delay[A](value: => A): Susp[A] = new SuspImpl[A](value) | |
implicit def force[A](s: Susp[A]): A = s() |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<projectDescription> | |
<name>kepler</name> | |
<comment></comment> | |
<projects> | |
</projects> | |
<buildSpec> | |
<buildCommand> | |
<name>org.eclipse.pde.ManifestBuilder</name> | |
<arguments> |
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
<?xml version="1.0" encoding="UTF-8"?> | |
<classpath> | |
<classpathentry kind="src" output="build/quick/classes/library" path="src/library"/> | |
<classpathentry kind="src" output="build/quick/classes/compiler" path="src/compiler"/> | |
<classpathentry kind="lib" path="lib/ant/ant-contrib.jar"/> | |
<classpathentry kind="lib" path="lib/ant/ant-dotnet-1.0.jar"/> | |
<classpathentry kind="lib" path="lib/ant/ant.jar"/> | |
<classpathentry kind="lib" path="lib/ant/maven-ant-tasks-2.1.1.jar"/> | |
<classpathentry kind="lib" path="lib/ant/vizant.jar"/> | |
<classpathentry kind="lib" path="lib/fjbg.jar"/> |
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
To be implemented |
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
Welcome to Scala version 2.10.0-20120418-145922-016bc3db52 (Java HotSpot(TM) 64-Bit Server VM, Java | |
1.6.0_25). | |
Type in expressions to have them evaluated. | |
Type :help for more information. | |
scala> Array[Unit]((), ()) | |
typechecking macro expansion materializeClassTag[Unit](`package`.this.mirror) at source-<console>,li | |
ne-8,offset=101 | |
ClassTag.Unit | |
Select(Ident(newTermName("ClassTag")), newTermName("Unit")) |