duplicate version reference - was #<syntax (scheme base) in #61>

Per Bothner per@bothner.com
Fri Nov 3 17:35:04 GMT 2023



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/


More information about the Kawa mailing list