public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: Damien Mattei <damien.mattei@gmail.com>
To: Per Bothner <per@bothner.com>
Cc: kawa mailing list <kawa@sourceware.org>
Subject: Re: unbound location: *
Date: Thu, 2 Nov 2023 22:51:05 +0100	[thread overview]
Message-ID: <CADEOade9jpjHpndhb+hoavxTD50gKei2Bd34NSz2j2T6_OsKgQ@mail.gmail.com> (raw)
In-Reply-To: <e9c854be-cbd1-4b54-8c37-3b8862ca21cf@bothner.com>

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/

  reply	other threads:[~2023-11-02 21:51 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-01  8:39 Damien Mattei
2023-11-01 12:22 ` Damien Mattei
2023-11-01 12:50   ` Damien Mattei
2023-11-01 14:02     ` Damien Mattei
2023-11-01 16:11       ` Damien Mattei
2023-11-01 16:47         ` Damien Mattei
2023-11-01 16:57           ` Per Bothner
2023-11-02 21:51             ` Damien Mattei [this message]
2023-11-02 21:58               ` Per Bothner
2023-11-03 10:42                 ` Damien Mattei
2023-11-03 10:48                   ` Damien Mattei
2023-11-01 14:55   ` Per Bothner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CADEOade9jpjHpndhb+hoavxTD50gKei2Bd34NSz2j2T6_OsKgQ@mail.gmail.com \
    --to=damien.mattei@gmail.com \
    --cc=kawa@sourceware.org \
    --cc=per@bothner.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).