with-syntax return error in Guile, not in Kawa or Racket

Damien Mattei <[email protected]>
Newsgroups gmane.lisp.guile.user
Message-ID <CADEOadebkem57=wotYRw1fsQ3kdqSZ9qbEk2Qe=6dcoG-X+fRA@mail.gmail.com>
hi,

Guile:

(base) mattei@mbp-touch-bar Scheme-PLUS-for-Guile % guile
GNU Guile 3.0.8.99-f3ea8
Copyright (C) 1995-2022 Free Software Foundation, Inc.

Guile comes with ABSOLUTELY NO WARRANTY; for details type `,show w'.
This program is free software, and you are welcome to redistribute it
under certain conditions; type `,show c' for details.

Enter `,help' for help.
scheme@(guile-user)> (define-syntax test-it

   (lambda (stx)

    (syntax-case stx ()

    ((_ term1)

     (with-syntax ((var (syntax->datum #'term1)))

       #'var)))))
scheme@(guile-user)> (test-it (+ 2 3))
While compiling expression:
Syntax error:
unknown file:#f:#f: encountered raw symbol in macro output in subform + of
(test-it (+ 2 3))

Kawa:

(base) mattei@mbp-touch-bar Scheme-PLUS-for-Guile % kawa
#|kawa:1|# (define-syntax test-it
#|.....2|#
#|.....3|#    (lambda (stx)
#|.....4|#
#|.....5|#     (syntax-case stx ()
#|.....6|#
#|.....7|#     ((_ term1)
#|.....8|#
#|.....9|#      (with-syntax ((var (syntax->datum #'term1)))
#|....10|#
#|....11|#        #'var)))))
#|....12|#
#|kawa:13|# (test-it (+ 2 3))
5

Racket:

Language: racket, with debugging; memory limit: 8192 MB.
> (define-syntax test-it

   (lambda (stx)

    (syntax-case stx ()

    ((_ term1)

     (with-syntax ((var (syntax->datum #'term1)))

       #'var)))))

> (test-it (+ 2 3))
5

why,why?

Damien
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.