chibi-scheme icon indicating copy to clipboard operation
chibi-scheme copied to clipboard

Segmentation fault (phasing issue)

Open mnieper opened this issue 4 years ago • 1 comments

The following program causes Chibi to segfault:

(import (scheme base)
	(only (chibi) er-macro-transformer))

(let ((x #f))
  (define-syntax foo
    (er-macro-transformer
     (lambda (e r c)
       x)))
  (foo))

The binding of the identifier x does not exist during the expansion of (foo), so the above code is an error. Chibi could handle it more gracefully.

mnieper avatar Aug 18 '21 19:08 mnieper

This is a known issue. The other version is:

(define-syntax foo (let ((x #f )) (er-macro-transformer ...)))

which some macro systems support but Chibi does not.

ashinn avatar Aug 18 '21 21:08 ashinn