Hi,<div><br></div><div>As an addition to the discussion, see <a href="http://paste.lisp.org/display/130806">http://paste.lisp.org/display/130806</a> in which I define a macro that behaves like doto for this example. Note that the JSS lisp paste had a typo - s/setsize/setSize/</div>
<div><br></div><div>This addresses your point 5 - macros are always possible ;-)</div><div><br></div><div>The main reason that I didn't use the dot notation for jss was that I don't want to live with a case sensitive reader all the time. OTOH if someone wants to offer up a readtable that reads case-sensitive at the right times (like after the "." for a symbol in the function position), that might be interesting to try.</div>
<div><br></div><div>Note that #"foo" reads as funcallable function - e.g. you can write </div><div><br></div><div>(funcall #"foo" arg1 arg2...) </div><div><br></div><div>Are the dot functions also regular functions in closure, or are they special forms? </div>
<div><br></div><div>-Alan<br><br><div class="gmail_quote">On Fri, Jul 20, 2012 at 10:22 AM, Frederico Muñoz <span dir="ltr"><<a href="mailto:fsmunoz@gmail.com" target="_blank">fsmunoz@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Greetings,<br>
<br>
I've been playing around with ABCL for some days now, especially in<br>
terms of the Java interop abilities and Swing. This is because I was<br>
searching for a Lisp that could be easily used for cross-platform GUI<br>
programming and easy deployed (for the user). This narrowed it down to<br>
the several JVM-based Lisps (ABCL, Kawa, etc) and Clojure.<br>
<br>
While I like Clojure - and "lein uberjar" is a great facility, for<br>
example - I'm more confortable in CL, so I did this two small examples<br>
that can perhaps be useful as a way to compare ABCL's different interop<br>
facilities with themselves and Clojure. In a way I used this to get a<br>
"feel" on how things would work out and make a decision.<br>
<br>
ABCL JSS Swing Example: <a href="http://paste.lisp.org/display/130606" target="_blank">http://paste.lisp.org/display/130606</a><br>
ABCL JFLI Swing Example: <a href="http://paste.lisp.org/display/130605" target="_blank">http://paste.lisp.org/display/130605</a><br>
<br>
I'm going to make another use using the lower-level API (jcall, etc),<br>
for the sake of completeness, but I think that perhaps this examples can<br>
be helpful to others as a small reference, using a well-known<br>
example. For me it was quite fun and my overall impressions thus far is<br>
that:<br>
<br>
1) ABCL offers different interop facilities that taken as a whole make<br>
it a quite capable solution for overall Java interop, including GUI<br>
programming.<br>
<br>
2) The JSS approach has the advantage of being less verbose since the<br>
methods need not contain the class name (which looks cleaner IMO). It is<br>
also simpler to setup, i.e. no need for def-java-class et. al.<br>
<br>
3) The JFLI approach integrates well with Lisp, since it provides<br>
completion of methods, amongst other small things. The lack of #"foo"<br>
syntax is also visually appealing IMO. It can also - theoretically - be<br>
used by JFLI installations in other Lisps. It is more verbose though,<br>
since methods must be preceeded with the class (class.foomethod)<br>
<br>
4) Clojure's approach is (naturally) conceptually quite similar to<br>
JFLI, in the "feel" that it provides, although the use of (.fooMethod<br>
instance) is similar to (#"fooMethod" instance) in terms of synxtax. The<br>
use of macros (like doto) significantly reduces number of words used.<br>
<br>
5) I see nothing in the way of implementing similar macro mechanisms on<br>
top of either JSS or JFLI - but I can be simplifying things brutally<br>
here.<br>
<br>
In the most simple scenario syntax differences are as follows:<br>
<br>
ABCL JSS: (#"setText" my-label "The Larch")<br>
ABCL JFLI: (jlabel.settext my-label "The Larch")<br>
Clojure: (.setText my-label "The Larch")<br>
<br>
The Clojure approach seems quite similar to the javadot approach of<br>
jscheme (<a href="http://jscheme.sourceforge.net/jscheme/doc/javadot.html" target="_blank">http://jscheme.sourceforge.net/jscheme/doc/javadot.html</a>), as<br>
noted in the ABCL blog - I was unaware of that.<br>
<br>
More complex approachs envolving the need for proxies contain more<br>
differences of course.<br>
<br>
I would greatly welcome any comments concerning style and approach: I am<br>
completely new to this so I am probably missing a lot. It was quite<br>
enjoyable though, even if there are still some rough edges here and<br>
there (quite understandable since for JFLI I had to used trunk). I think<br>
that this is an area worth exploration, easy (meaning well-integrated,<br>
clear syntax, small impact) interop is a huge advantage.<br>
<br>
Thank you for your hard work, highly appreciated.<br>
<br>
Cheers,<br>
<br>
Frederico<br>
<br>
_______________________________________________<br>
armedbear-devel mailing list<br>
<a href="mailto:armedbear-devel@common-lisp.net">armedbear-devel@common-lisp.net</a><br>
<a href="http://lists.common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel" target="_blank">http://lists.common-lisp.net/cgi-bin/mailman/listinfo/armedbear-devel</a><br>
</blockquote></div><br></div>