From: Damien Mattei <damien.mattei@gmail.com>
To: Per Bothner <per@bothner.com>
Cc: kawa@sourceware.org
Subject: Re: duplicate version reference - was #<syntax (scheme base) in #61>
Date: Fri, 3 Nov 2023 18:57:39 +0100 [thread overview]
Message-ID: <CADEOadePp2L-bjttw_9PUuaEx02ZhixnxAieLNNh52kVhPNoaA@mail.gmail.com> (raw)
In-Reply-To: <c4a14b4c-7744-4f7a-b031-8d515a6704dd@bothner.com>
i understand. For my overloading operator idea, do you think is it
possible in Kawa (like in guile: (define-method (+ (x <vector>) (y
<vector>)) (vector-append x y)) ),using the class and defining method
to overload some operators like + ,* ,etc ? and even do it for basic
type like vectors? allowing the use of + instead of vector-append?
On Fri, Nov 3, 2023 at 6:35 PM Per Bothner <per@bothner.com> wrote:
>
>
>
> On 11/3/23 10:25, Damien Mattei via Kawa wrote:
> > but if i put the statement in a macro, it no more works:
> > kawa -Dkawa.import.path="."
> > #|kawa:1|# (define-syntax define-overload-existing-operator
> > #|.....2|#
> > #|.....3|# (syntax-rules ()
> > #|.....4|#
> > #|.....5|# ((_ proc) (import (rename (scheme base) (proc orig-proc))))))
> > #|kawa:6|# (define-overload-existing-operator +)
> > /dev/tty:6:1: duplicate version reference - was #<syntax (scheme base) in #61>
> > /dev/tty:6:1: unknown library (#<syntax#3 rename in #61>)
>
> To start with, orig-proc is undefined. proc and orig-proc are completely unrelated identifiers.
>
> Generating a new identifier orig-proc based on an existing identifier proc
> is possible (using syntax->datum and datum->syntax) but it's tricky.
>
> Using import in a macro expansion may have some issues or bugs
> I haven't really thought about, at least not in a long time.
> --
> --Per Bothner
> per@bothner.com http://per.bothner.com/
next prev parent reply other threads:[~2023-11-03 17:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-11-03 17:25 Damien Mattei
2023-11-03 17:35 ` Per Bothner
2023-11-03 17:57 ` Damien Mattei [this message]
2023-11-03 18:29 ` Per Bothner
2023-11-03 23:48 ` Damien Mattei
2023-11-04 14:56 ` Damien Mattei
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=CADEOadePp2L-bjttw_9PUuaEx02ZhixnxAieLNNh52kVhPNoaA@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).