Skip to content

Instantly share code, notes, and snippets.

# Say we're both working on the same project, and I've just created
# a new branch for my cool new feature and pushed it up to my
# github-hosted repo on a branch called "feature".
# Inside your local copy of the repo:
# create a new remote called "johnreilly" for the repo located at github
git remote add johnreilly git://github.com/johnreilly/project.git
# do a fetch of the remote repository
usePlugin 'groovy'
usePlugin(com.smokejumperit.gradle.CukePlugin)
buildscript {
repositories {
mavenRepo urls:'http://repo.smokejumperit.com'
}
dependencies {
classpath 'com.smokejumperit:gradle-plugins:0.5.1'
}
Running data flow operator demo
x was set to 23
x was set to 23
An exception occurred in the Actor thread Actor Thread 2
java.lang.IllegalStateException: A DataFlowVariable can only be assigned once.
at groovyx.gpars.dataflow.DataFlowExpression.bind(DataFlowExpression.java:292)
at groovyx.gpars.dataflow.DataFlowVariable.leftShift(DataFlowVariable.java:50)
at groovyx.gpars.dataflow.DataFlowVariable$leftShift.call(Unknown Source)
at groovyx.gpars.dataflow.operator.DataFlowOperator.bindOutput(DataFlowOperator.groovy:82)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
let foo = 42 in exec(foo);
let foo = 42 in {
doSomething(foo);
somethingElse(foo)
}
let foo = { arg1, arg2 ->
someAnonymousFunctionImpl(arg1, arg2)
};
loop (x, y, z);
if(x == true) recur(false, y, z);
return y + z;
@groovy(foo,bar,baz) @@
import groovy.xml.*
println "This totally isn't ashlar code!"
@@@
@groovy(foo,bar,baz) <<<
import groovy.xml.*
println "This totally isn't ashlar code!"
// This works
class Foo(bar:Int) {
def this(bar1:Int, bar2:Int) = this(bar1 + bar2)
}
@RobertFischer
RobertFischer / Revenge of the NPE.scala
Created August 26, 2010 14:55
The order of initialization is vital in Scala; it's hosing things up for me.
abstract class X {
val foo:String
val bar = makeBar(foo)
}
class Y extends X {
val foo = "Hello, World!"
}
@RobertFischer
RobertFischer / foo.groovy
Created June 9, 2011 14:51
Groovy Demonistration of Resolving (String, int, Object) in the face of (String, Object...) and (String, int, Object...)
def x(String a, int b, Object... c) { "1" }
def x(String a, Object... c) { "2" }
System.out.println(x("a", 1, new Object()))
@RobertFischer
RobertFischer / X.scala
Created June 9, 2011 14:51
Scala Demonistration of Resolving (String, int, Object) in the face of (String, Object...) and (String, int, Object...)
object X {
def x(a:String, b:Int, c:Object*):String = { "1" }
def x(a:String, c:Object*):String = { "2" }
def doIt() = {
System.out.println(x("a", 2, new Object()))
}
}