Re: Ersatz warnings in Eclipse

2013-07-18 Thread Jon Kleiser

Hi Alex,

It's working fine now. Eclipse is also much happier. ;-)

/Jon

On 17-07-13 21:05 , Alexander Burger wrote:

On Wed, Jul 17, 2013 at 08:24:45PM +0200, Alexander Burger wrote:

I'll fix that. Thanks!

Done :)

I've fixed all other places too where it complained about unused
variables (these were really unused ones), and have uploaded a new
release.

Please test again whenever you have time!

♪♫ Alex


--
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Ersatz warnings in Eclipse

2013-07-17 Thread Alexander Burger
Hi Jon,

thanks for the input!

 obtain the PicoLisp.java source for the ersatz/picolisp.jar, I did
 cd ersatz/
 pil mkJar +
 
 I then created an empty Java project in Eclipse and imported the 
 PicoLisp.java source. To avoid a NullPointerException when running my 
 project, I entered -DPID=999 into 'VM arguments' in 'Run 
 Configurations'. (999 just seemed to work for now. $$ did not.) Then I 
 could do simple PicoLisp stuff in the Eclipse Console. ;-)

Great!


 However, Eclipse gave me 36 warnings. They may mean next to nothing for 
 the Ersatz execution. Most of the warnings (23) were The value of the 
 local variable ... is not used. In case you should want to do some 
 cleaning up when having some spare time, I have attached a zip file 
 containing the (tab separated) warnings.txt (and the PicoLisp.java).

OK. First I removed

   import java.nio.channels.spi.*;

from ersatz/sys.src, it seems indeed not necessary.


But I don't get the point with the messages

   The value of the local variable next is not used   PicoLisp.java  
/Ersatz/src line 1507   Java Problem

because 'next' is in fact used (and needed!) in all those cases.

How come?


Also, I'm not sure about those is a raw type messages. My Java
knowledge is rather outdated, I'm afraid. How to fix those?

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Ersatz warnings in Eclipse

2013-07-17 Thread Jon Kleiser
Hi Alex,

 Hi Jon,

 thanks for the input!

 obtain the PicoLisp.java source for the ersatz/picolisp.jar, I did
 cd ersatz/
 pil mkJar +

 I then created an empty Java project in Eclipse and imported the
 PicoLisp.java source. To avoid a NullPointerException when running my
 project, I entered -DPID=999 into 'VM arguments' in 'Run
 Configurations'. (999 just seemed to work for now. $$ did not.) Then I
 could do simple PicoLisp stuff in the Eclipse Console. ;-)

 Great!


 However, Eclipse gave me 36 warnings. They may mean next to nothing for
 the Ersatz execution. Most of the warnings (23) were The value of the
 local variable ... is not used. In case you should want to do some
 cleaning up when having some spare time, I have attached a zip file
 containing the (tab separated) warnings.txt (and the PicoLisp.java).

 OK. First I removed

import java.nio.channels.spi.*;

 from ersatz/sys.src, it seems indeed not necessary.


 But I don't get the point with the messages

The value of the local variable next is not used   PicoLisp.java
 /Ersatz/src line 1507   Java Problem

 because 'next' is in fact used (and needed!) in all those cases.

 How come?

I cannot see one place where the value of 'next' is used (read/retrieved).
Can you tell me which line?

 Also, I'm not sure about those is a raw type messages. My Java
 knowledge is rather outdated, I'm afraid. How to fix those?

 ?? Alex

At the moment, I'm not sure if one should care about those raw types.
Maybe someone with more up to date Java knowledge can tell? ;-)

/Jon

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Ersatz warnings in Eclipse

2013-07-17 Thread Alexander Burger
Hi Jon,

  because 'next' is in fact used (and needed!) in all those cases.
 
  How come?
 
 I cannot see one place where the value of 'next' is used (read/retrieved).
 Can you tell me which line?

Yes, for example the one where Eclipse is complaining about:

   The value of the local variable next is not used ... line 1507

Starting from line 1507:

 int next, argc, j = 0;
 Any arg, args[], av[] = null;
 if (x instanceof Cell) {
av = new Any[6];
do
   av = append(av, j++, x.Car.eval());
while ((x = x.Cdr) instanceof Cell);
 }
 next = Env.Next;  Env.Next = 0;

So here 'next' is used.

 At the moment, I'm not sure if one should care about those raw types.
 Maybe someone with more up to date Java knowledge can tell? ;-)

Yeah :)

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Ersatz warnings in Eclipse

2013-07-17 Thread Jon Kleiser
Hi Alex,

 Hi Jon,

  because 'next' is in fact used (and needed!) in all those cases.
 
  How come?

 I cannot see one place where the value of 'next' is used
 (read/retrieved).
 Can you tell me which line?

 Yes, for example the one where Eclipse is complaining about:

The value of the local variable next is not used ... line 1507

 Starting from line 1507:

  int next, argc, j = 0;
  Any arg, args[], av[] = null;
  if (x instanceof Cell) {
 av = new Any[6];
 do
av = append(av, j++, x.Car.eval());
 while ((x = x.Cdr) instanceof Cell);
  }
  next = Env.Next;  Env.Next = 0;

 So here 'next' is used.

Not really. A value (from Env.Next) is stored in 'next', but that value is
never retrieved from 'next' later. Therefor 'next' is considered useless.

/Jon

 At the moment, I'm not sure if one should care about those raw types.
 Maybe someone with more up to date Java knowledge can tell? ;-)

 Yeah :)

 ?? Alex

-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Ersatz warnings in Eclipse

2013-07-17 Thread Alexander Burger
Hi Jon,

   next = Env.Next;  Env.Next = 0;
 
  So here 'next' is used.
 
 Not really. A value (from Env.Next) is stored in 'next', but that value is
 never retrieved from 'next' later. Therefor 'next' is considered useless.

Ah! Cool! That's the problem.

'next' is indeed necessary, and the above assignment is correct. The bug
is that this *retrieval* somehow got lost, so nested function calls with
variable arguments (i.e. the '@' mechanism) will unnest properly.

This bug can be produced by nesting two vararg-functions:

   (de f @
  (g 1 2)
  (println (next)) )

   (de g @
  (println (next)) )

   (f 3)

PicoLisp correctly prints 1 and 3, but Ersatz gives a
NullPointerException because 'Env.Next' is never restored when 'g'
terminates.

I'll fix that. Thanks!

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe


Re: Ersatz warnings in Eclipse

2013-07-17 Thread Alexander Burger
On Wed, Jul 17, 2013 at 08:24:45PM +0200, Alexander Burger wrote:
 I'll fix that. Thanks!

Done :)

I've fixed all other places too where it complained about unused
variables (these were really unused ones), and have uploaded a new
release.

Please test again whenever you have time!

♪♫ Alex
-- 
UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe