Skip to content

Instantly share code, notes, and snippets.

@cv
Created January 31, 2009 17:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cv/55597 to your computer and use it in GitHub Desktop.
Save cv/55597 to your computer and use it in GitHub Desktop.
; I'm assuming the Java namespace will have a bunch of interesting utilities for Java interop - naming might change.
Java method = dsyntax("",
[javaCode]
; use ASM some other bytecode writing API to create a child of JavaMethod or JavaMethod.WithNoArguments, load it and return it
)
Text lower = Java method("Returns a lower case version of this text",
public Object activate(IokeObject method, IokeObject context, IokeObject message, Object on) throws ControlFlow {
getArguments().getValidatedArgumentsAndReceiver(context, message, on, new ArrayList<Object>(), new HashMap<String, Object>());
return method.runtime.newText(Text.getText(on).toLowerCase());
}
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment