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
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,

> >  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 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,

> > 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,
>
> 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,

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


Ersatz warnings in Eclipse

2013-07-17 Thread Jon Kleiser

Hi Alex,

Today I got the idea that I would like to run Ersatz in Eclipse. To 
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. ;-)


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).


/Jon

--070008000406000703070203
Content-Type: application/zip;
name="ersatz-warnings.zip"
Content-Transfer-Encoding: base64
Content-Disposition: attachment;
filename="ersatz-warnings.zip"

UEsDBAoAAMt68UIQABAAZXJzYXR6LXdhcm5pbmdzL1VYDAC9muZR
jZrmUfUBFABQSwMEFAAIAAgAVXnxQgAAAB0AEABlcnNhdHotd2FybmluZ3Mv
UGljb0xpc3AuamF2YVVYDADHmuZR0pfmUfUBFADsfXt/20aS4P/zKWDt7piMKIaA3pZlj+3Y
N96x42zsZG42452DSEiCRQI0AEqkZnyf/br6hX5Vo0nLSWYu/CUWCfSzqrq6Xl399ddRPPqw
mMa76dnid19/HfXG/ehted7cpFUWvUrPhtGTabZMi0lWRU8X1UVW/e53+WxeVk30Ib1Oh4sm
nw6/OtGezdLm0nyWl+aTImusR45S5NH4Mi2KbFp739Xz3Hw/TYuLYZWdT7Mx7ep3X38VPa/q
tLmNvsvH5au8nkcviyar5lVG/o1635VlFb1Oi/u1LNCPvvr6d/PF2TQfR+NpWrdvor//Loqi
87xIp1HdpA0p8Kws6nKaRe+yahadRm9XdZP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