Skip to content

Instantly share code, notes, and snippets.

@samaaron
Created January 15, 2009 22:51
Show Gist options
  • Select an option

  • Save samaaron/47682 to your computer and use it in GitHub Desktop.

Select an option

Save samaaron/47682 to your computer and use it in GitHub Desktop.
obj.registerMethod(runtime.newJavaMethod("will remove all the entries from the list, and then returns the list", new JavaMethod.WithNoArguments("clear!") {
@Override
public Object activate(IokeObject method, IokeObject context, IokeObject message, Object on) throws ControlFlow {
getArguments().getEvaluatedArguments(context, message, on, new ArrayList<Object>(), new HashMap<String, Object>());
Object onAsList = IokeList.convertTo(on, true, message, context);
IokeList.getList(onAsList).clear();
return onAsList;
}
}));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment