bugKawa - Bugs: bug #8973, define-private functions not...

 
 

bug #8973: define-private functions not accessible from everywhere in a module

Submitted by:  Chris Dean <ctdean>
Submitted on:  Sun 16 May 2004 02:48:38 AM UTC  
 
Category: Code generationSeverity: 3 - Normal
Item Group: Run-time exceptionStatus: Works For Me
Privacy: PublicAssigned to: Per Bothner <bothner>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Mon 17 May 2004 04:19:25 AM UTC, comment #3:

Still happens, but only inside my larger program. Perhaps it's
related to some bootstrapping issue on my side? I'll check
to see if we're doing something funny with the ClassLoader.

|EXCEPTION OCCURRED ----- java.lang.IllegalAccessError: tried to access

> method
> gnu.kawa.slib.srfi1.$PcCars$PlCdrs(Ljava/lang/Object;)Ljava/lang/Object;
> from class gnu.kawa.slib.srfi1$frame27
> gnu.kawa.slib.srfi1$frame27.lambda61(srfi1.scm:963)
> gnu.kawa.slib.srfi1$frame27.apply0(srfi1.scm)
> gnu.expr.ModuleMethod.apply0(ModuleMethod.java:81)
> kawa.standard.call_with_values.callWithValues(call_with_values.java:10)
> kawa.standard.call_with_values.apply2(call_with_values.java:19)
> gnu.kawa.slib.srfi1$frame26.lambda59recur(srfi1.scm:963)
> gnu.kawa.slib.srfi1.filterMap$V(srfi1.scm:962)
>

Chris Dean <ctdean>
Mon 17 May 2004 02:41:33 AM UTC, comment #2:

Well no I can't replicate it either! Shoot. I'll run through
my regression test and see if I can find it somewhere else besides count.

Chris Dean <ctdean>
Sun 16 May 2004 10:44:32 PM UTC, comment #1:

Hmm. Another one where it works for me:

$ java kawa.repl
#|kawa:1|# (require 'list-lib)
#|kawa:2|# (count < '(1 2 4 8) '(2 4 6 8 10 12 14 16))
3

> Perhaps define-private functions should be implemented as "package scope"?


There is a mechanism for handling this, that is used for public macros that reference private data. We should extend that mechanism, if needed.

> Sometimes define-private functions get used in a named let or letrec whose body is implemented as a separate class.


I'd like to reduce the number of such classes. From the TODO file:
If a local variable is captured, and all functions intermediate between the capture site and the definition are call-only functions, and the local variable is never written (except before all calls to these intermediate functions), then add the variable as an extra implicit parameter to thse intermediate functions, instead of storing the variable in a frame.

Per Bothner <bothner>
Project AdministratorIn charge of this item.
Sun 16 May 2004 02:48:38 AM UTC, original submission:

Sometimes define-private functions get used in a named let or letrec whose body is implemented as a separate class.
That is, for some module M with a private function p we
will generate the private method M.p. If there is also a
function f then parts of the body of f might be generated
in M$frame1.lambda1recur. If lambda1recur calls M.p we will
get a runtime error.

Perhaps define-private functions should be implemented as
"package scope"?

Here's an example from srfi1:

#|kawa:2|# (count < '(1 2 4 8) '(2 4 6 8 10 12 14 16))
java.lang.IllegalAccessError: tried to access method gnu.kawa.slib.srfi1.$PcCars$PlCdrs(Ljava/lang/Object;)Ljava/lang/Object; from class gnu.kawa.slib.srfi1$frame6
at gnu.kawa.slib.srfi1$frame6.lambda21(srfi1.scm:802)
at gnu.kawa.slib.srfi1$frame6.apply0(srfi1.scm)
at gnu.expr.ModuleMethod.apply0(ModuleMethod.java:81)
at kawa.standard.call_with_values.callWithValues(call_with_values.java:10)
at kawa.standard.call_with_values.apply2(call_with_values.java:19)
at gnu.kawa.slib.srfi1$frame5.lambda20lp(srfi1.scm:802)
at gnu.kawa.slib.srfi1.count$V(srfi1.scm:800)

Chris Dean <ctdean>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 3 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Mon 13 Dec 2004 12:43:05 AM UTCbothnerOpen/ClosedOpen=>Closed
Sun 16 May 2004 10:44:32 PM UTCbothnerStatusNone=>Works For Me
  Assigned toNone=>bothner

Back to the top


Powered by Savane 3.1-cleanup1