Russ McManus | 16 Aug 02:44
Favicon

improved swank browsing for java objects


I got frustrated that I couldn't arbitrarily inspect java classes,
methods, and objects, and came up with the following.

Please give it a try and let me know what you think.

Note that I tried to implement this with EQL specializers and
DEFMETHOD, but apparently this is presently beyond the capability of
ABCL's CLOS implementation.

-russ

(defmethod swank:emacs-inspect ((java-object java-object))
  (emacs-inspect-java java-object))

(defun swank-backend::emacs-inspect-java-class (jclass)
  (flet ((jclass->name (jclass)
           (let* ((s (jclass-name jclass))
                  (prefix "java.lang.")
                  (lang-pos (search prefix s)))
             (if lang-pos
                 (subseq s (+ lang-pos (length prefix)))
                 s))))
    (append 
     `("Java Class: " ,(princ-to-string jclass) (:newline))
     `("Methods" (:newline))
     (loop for method across (jclass-methods jclass)
        for i = 0 then (1+ i)
        append (let ((args (mapcar #'jclass->name (coerce (jmethod-params method) 'list))))
                 `(,(format nil "[~2D] ~A ~A(~{~A~^,~}): ~40T" 
(Continue reading)

Mark Evenson | 17 Aug 10:09

Re: improved swank browsing for java objects


On Aug 16, 2008, at 02:48 , Russ McManus wrote:

>
> I got frustrated that I couldn't arbitrarily inspect java classes,
> methods, and objects, and came up with the following.
>
> Please give it a try and let me know what you think.

Looks cool (the opacity of Java objects from the abcl inspector always  
bugged me as well), but I can't seem to get it to run.

I am trying to get this to run by patching a SLIME from CVS outside of  
the abcl tree.  Are you just patching the SLIME files inside the tree?

Well, back to improving my understanding of the SLIME packaging…

Mark

--
"A screaming comes across the sky.  It has happened before, but there  
is nothing to compare to it now."

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/
russell_mcmanus | 18 Aug 01:40
Favicon

Re: improved swank browsing for java objects

This isnt in patch format.

Just evaluate the the forms in slime scratch.

Russ

------Original Message------
From: Mark Evenson
To: Russ McManus
Cc: armedbear-j-devel <at> lists.sourceforge.net
Sent: Aug 17, 2008 3:09 AM
Subject: Re: [j-devel] improved swank browsing for java objects

On Aug 16, 2008, at 02:48 , Russ McManus wrote:

>
> I got frustrated that I couldn't arbitrarily inspect java classes,
> methods, and objects, and came up with the following.
>
> Please give it a try and let me know what you think.

Looks cool (the opacity of Java objects from the abcl inspector always  
bugged me as well), but I can't seem to get it to run.

I am trying to get this to run by patching a SLIME from CVS outside of  
the abcl tree.  Are you just patching the SLIME files inside the tree?

Well, back to improving my understanding of the SLIME packaging…

Mark
(Continue reading)

Mark Evenson | 4 Oct 13:29

Converted to diff against SLIME (was Re: improved swank browsing for java objects)

Russ McManus wrote:
> I got frustrated that I couldn't arbitrarily inspect java classes,
> methods, and objects, and came up with the following.
> 
> Please give it a try and let me know what you think.

This is really fantastic, making ABCL+SLIME *much* easier to use, 
especially when one is stumbling around interactively discovering Java APIs.

I find your code so useful, that I converted your patch to work against 
CVS HEAD as of 2008-09-28 so that I don't have to remember to load it 
each time I restart ABCL.  Other than explicitly scoping the needed 
symbols in JAVA with package qualifiers, I haven't touched you code very 
much other than starting to experiment with truncating some of the 
longer inspection presentation lines that one gets with extremely long 
Java package names.

Russ:  I would like to get your code with credit for you as the 
originator into the SLIME CVS repository once I am satisfied with the 
presentation layout.  Is that ok?

> Note that I tried to implement this with EQL specializers and
> DEFMETHOD, but apparently this is presently beyond the capability of
> ABCL's CLOS implementation.

Noted as a point to look at once we start getting seriously into 
debugging CLOS.

Mark <evenson <at> panix.com>

(Continue reading)

Russell McManus | 4 Oct 14:09
Favicon

Re: Converted to diff against SLIME (was Re: improved swank browsing for java objects)


> Russ:  I would like to get your code with credit for you as the 
> originator into the SLIME CVS repository once I am satisfied with the 
> presentation layout.  Is that ok?

Sure, sounds good.

-russ

-------------------------------------------------------------------------
This SF.Net email is sponsored by the Moblin Your Move Developer's challenge
Build the coolest Linux based applications with Moblin SDK & win great prizes
Grand prize is a trip for two to an Open Source event anywhere in the world
http://moblin-contest.org/redirect.php?banner_id=100&url=/

Gmane