unbound location: *
Damien Mattei
damien.mattei@gmail.com
Thu Nov 2 21:51:05 GMT 2023
seems a good idea but i can not fix it, i try:
(import (rename (gnu kawa) (proc orig-proc)))
and (import (rename (overload) (proc orig-proc)))
as my code is in module 'overload' but the latter result in a crash:
main-test-define.scm:4:1: duplicate version reference - was #<syntax
(overload) in #3164>
main-test-define.scm:4:1: unknown library (#<syntax#2346 rename in #3164>)
#|kawa:3|# +
Exception in thread "main" java.lang.VerifyError: Bad local variable type
Exception Details:
Location:
atInteractiveLevel-5.run(Lgnu/mapping/CallContext;)V @6: aload_3
Reason:
Type top (current frame, locals[3]) is not assignable to reference type
Current Frame:
bci: @6
flags: { }
locals: { 'atInteractiveLevel-5', 'gnu/mapping/CallContext',
'gnu/lists/Consumer' }
stack: { 'gnu/lists/Consumer' }
Bytecode:
0000000: 2bb4 0008 4d2c 2db9 000e 0200 b1
at java.base/java.lang.Class.getDeclaredFields0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3473)
at java.base/java.lang.Class.getDeclaredField(Class.java:2780)
at gnu.expr.ModuleContext.findInstance(ModuleContext.java:71)
at gnu.expr.ModuleExp.evalModule2(ModuleExp.java:286)
at gnu.expr.ModuleExp.evalModule(ModuleExp.java:211)
at kawa.Shell.run(Shell.java:289)
at kawa.Shell.run(Shell.java:196)
at kawa.Shell.run(Shell.java:183)
at kawa.repl.processArgs(repl.java:724)
at kawa.repl.main(repl.java:830)
my goal is just to back-up proc under the name orig-proc as i need to
reuse it latter.
On Wed, Nov 1, 2023 at 5:58 PM Per Bothner <per@bothner.com> wrote:
>
>
>
> On 11/1/23 09:47, Damien Mattei wrote:
> > but i have no more access to previous definition that is not keep in
> > the overloaded procedure,see #!null values:
>
> If you're using the module system, you can use import-with-rename
> to access the "old" definition:
>
> (import (rename other-module (foo other-foo)))
> (export foo)
>
> (define (foo ...)
> (cond (xxx (other-foo ...))
> (else ...)))
>
> See https://www.gnu.org/software/kawa/Importing.html
> --
> --Per Bothner
> per@bothner.com http://per.bothner.com/
More information about the Kawa
mailing list