Right,

Hello abcl developers,

Let's say I want to implement an anonymous inner class, just for example ActionListener with method actionPerformed:

JButton button = new JButton("Enter");
button.addActionListener(new ActionListener (){
public void actionPerformed(ActionEvent e){

System.out.println("The Enter button was pressed");
}
});

What is the best way to do this in abcl?


Cheers,
Patrice



On Tue, Aug 16, 2011 at 4:09 PM, Alan Ruttenberg <alanruttenberg@gmail.com> wrote:


On Tue, Aug 16, 2011 at 3:55 PM, Patrice Seyed <apseyed@gmail.com> wrote:
How about a boolean?

(make-immediate-object nil :boolean)
(make-immediate-object t :boolean)
 
Next, I'm trying to work my way up to defining anonymous inner classes from within abcl.

That's a bit more problematic, at least for me.
Can you write up a specific small code example you want to implement and send a note the armedbear-devel@common-lisp.net asking for what the recommended approach would be?

-Alan
 
 

Patrice

On Mon, Aug 15, 2011 at 5:53 PM, Alan Ruttenberg <alanruttenberg@gmail.com> wrote:
null = (make-immediate-object nil :ref)

On Mon, Aug 15, 2011 at 4:06 PM, Patrice Seyed <apseyed@gmail.com> wrote:
> Alan,
>
> If I wanted to pass as an argument that I would specify as null in
> java, from abcl to java, how would I do that?
>
> For example a method called method1 that takes two argument that I
> want to pass a string and the second argument null:
>
> (#"method1" 'ClassName "string" nil)
>
> If I specify nil as i did here I get a java exception "argument type mismatch".
>
> Patrice
>