use of clojure.lang.Var in project enclojure by EricThorsen.
the class ReplPanel method createReplEditorPane.
public void createReplEditorPane() {
try {
Var createReplEditorPaneFn = RT.var("org.enclojure.ide.repl.repl-panel", "create-repl-editor-pane");
_replEditorPane = (JEditorPane) createReplEditorPaneFn.invoke(this);
} catch (Exception ex) {
Logger.getLogger(ReplPanel.class.getName()).log(Level.SEVERE, null, ex);
}
//??_replEditorPane.setInheritsPopupMenu(true);
jScrollPaneRepl.setViewportView(_replEditorPane);
_replEditorPane.getDocument().addUndoableEditListener(new UndoableEditListener() {
public void undoableEditHappened(UndoableEditEvent e) {
_undoManager.addEdit(e.getEdit());
}
});
_replEditorPane.addKeyListener(new java.awt.event.KeyAdapter() {
public void keyTyped(java.awt.event.KeyEvent evt) {
processCharInput(evt);
}
public void keyPressed(java.awt.event.KeyEvent evt) {
processKeyInput(evt);
}
});
}
use of clojure.lang.Var in project enumerable by hraberg.
the class ClojureTest method defnLambda.
@Test
public void defnLambda() throws Exception {
Var square = defn("square", fn(n, n * n));
assertEquals(4, square.invoke(2));
Var found = var(CURRENT_NS.get().toString(), "square");
assertSame(square, found);
ISeq squares = (map(square, list(2, 4)));
assertEquals(list(4, 16), squares);
}
Aggregations