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: Sat, 4 Nov 2023 00:48:29 +0100 [thread overview]
Message-ID: <CADEOadeeP1QYn6HXTSJY3P3xXaK_OXHm2H36_9-4XWGd27HdXQ@mail.gmail.com> (raw)
In-Reply-To: <65a5c611-8d7a-4066-ad44-5f1a72283fd7@bothner.com>
On Fri, Nov 3, 2023 at 7:29 PM Per Bothner <per@bothner.com> wrote:
> First, I think using + for vector-append is a bad idea.
not part to be always defined like that
> It's questionable for strings, but if + on vectors would be
> better to mean vector addition - i.e. mapping + element-by-element.
just to port from Python a test example as in python + is used to append vectors
> (Of course my exposure to APL is influencing me here.)
:-)
>
> Second, Kawa has some half-assed support for "multi-methods":
> https://www.gnu.org/software/kawa/Generic-procedures.html
> That could be enhanced.
sounds great, a fast test give good results:
#|kawa:1|# (import (rename (scheme base) (+ orig+)))
#|kawa:4|# (define + (make-procedure method: (lambda (x ::number y
::number) (orig+ x y))
#|.....5|# method: (lambda (x ::vector y ::vector) (vector-append x y))))
#|kawa:6|# (+ 2 3)
5
#|kawa:7|# (+ #(1 2) #(3 4 5))
#(1 2 3 4 5)
could be enhanced for associative n-arity operator of course, the way
i did it in overload procedures
Damien
next prev parent reply other threads:[~2023-11-03 23:48 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
2023-11-03 18:29 ` Per Bothner
2023-11-03 23:48 ` Damien Mattei [this message]
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=CADEOadeeP1QYn6HXTSJY3P3xXaK_OXHm2H36_9-4XWGd27HdXQ@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).