LispWriter { public void writeForm(List<Cons> list) { output.print("("); for (int i = 0; i < list.size(); i++) { if (i > 0) { output.print(" "); } writeUnknown(list.get(i)); } output.print(")"); } LispWriter(PrintWriter dest); boolean isAutoQuoteLists(); void setAutoQuoteLists(boolean autoQuoteLists); void writeList(List<Cons> list); void writeForm(List<Cons> list); void writeAlist(Map<Object, Object> map); void writeCons(Cons cons); void writeString(String string); void writeInt(int n); void writeInt(Integer n); void writeLong(long n); void writeLong(Long n); void writeFloat(float f); void writeFloat(Float f); void writeDouble(double d); void writeDouble(Double d); void writeChar(char c); void writeChar(Character c); void writeBoolean(boolean b); void writeBoolean(Boolean b); void writeT(); void writeNil(); void writeSymbol(Symbol name); void writeQuoted(Quoted q); void writeUnknown(Object o); static final Symbol T; static final Symbol NIL; static final Quoted NULL; }
@Test public void testWriteJdeeJuciInvokeElispForm() { List eval = new ArrayList(); eval.add(new Symbol("jdee-juci-invoke-elisp")); List form = new ArrayList(); form.add(new Symbol("message")); form.addAll(Arrays.asList("hello %s", "nick")); eval.add(form); lwriter.writeForm(eval); assertEquals("(jdee-juci-invoke-elisp '(message \"hello %s\" \"nick\"))", output.toString()); }