bug-kawa
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-kawa] [bugs #8973] define-private functions not accessible from eve


From: Per Bothner
Subject: [Bug-kawa] [bugs #8973] define-private functions not accessible from everywhere in a module
Date: Sun, 12 Dec 2004 19:54:47 -0500
User-agent: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.7.2) Gecko/20040803

This mail is an automated notification from the bugs tracker
 of the project: Kawa.

/**************************************************************************/
[bugs #8973] Latest Modifications:

Changes by: 
                Per Bothner <address@hidden>
'Date: 
                Mon 12/13/2004 at 00:43 (GMT)

            What     | Removed                   | Added
---------------------------------------------------------------------------
              Status | Open                      | Closed







/**************************************************************************/
[bugs #8973] Full Item Snapshot:

URL: <http://savannah.gnu.org/bugs/?func=detailitem&item_id=8973>
Project: Kawa
Submitted by: Chris Dean
On: Sun 05/16/2004 at 02:48

Category:  Code generation
Severity:  5 - Average
Item Group:  Run-time exception
Resolution:  Unreproducible
Privacy:  Public
Assigned to:  bothner
Status:  Closed


Summary:  define-private functions not accessible from everywhere in a module

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)

Follow-up Comments
------------------


-------------------------------------------------------
Date: Mon 05/17/2004 at 04:19       By: Chris Dean <ctdean>
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)
> 

-------------------------------------------------------
Date: Mon 05/17/2004 at 02:41       By: Chris Dean <ctdean>
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.


-------------------------------------------------------
Date: Sun 05/16/2004 at 22:44       By: Per Bothner <bothner>
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.












For detailed info, follow this link:
<http://savannah.gnu.org/bugs/?func=detailitem&item_id=8973>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/







reply via email to

[Prev in Thread] Current Thread [Next in Thread]