Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Internal define inserted by a macro is not recognized #221

shirok opened this Issue Aug 6, 2016 · 0 comments


None yet
1 participant
Copy link

shirok commented Aug 6, 2016


(define-library (test-lib)
  (export my-define)
  (import (scheme base))
    (define-syntax my-define
      (syntax-rules ()
        ((_ var expr)
           (define var expr)

(import (scheme base))
(import (only (gauche base) add-load-path use print))
(add-load-path "." :relative)
(import (test-lib))
;(use test-mod)

(define (f)
  (my-define x 100)
  (+ x 1))

(print (f))

*** ERROR: syntax-error: the form can appear only in the toplevel: (#<identifier
 test-lib##<identifier test-lib#define.2d13860>.2d13500> x 100)
    While compiling "./test.scm" at line 7: (define (f) (my-define x 100) (+ x 1
    While loading "./test.scm" at line 9

@shirok shirok closed this in a105612 May 2, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.