[Bug] csc infinitely loops on expansion of macro that csi expands normally

Peter McGoron <[email protected]>
Newsgroups gmane.lisp.scheme.chicken
Message-ID <[email protected]>
Hello,

csc enters an infinite loop attempting to expand the following:

	(define-syntax make-alist
	  (syntax-rules ()
	    ((make-alist (key val) ...)
	     (list (cons key val) ...))))
	
	(display (caar (make-alist ("cons" cons))))
	(newline)

Loading the file into csi prints "cons" as normal.

The behavior seems to be specific to the symbol "cons": csc and csi both 
successfully expand all of the following:

---------------------------------------------------------

	(define-syntax make-alist
	  (syntax-rules ()
	    ((make-alist (key val) ...)
	     (list (cons key val) ...))))
	
	(display (caar (make-alist ("cons" car))))
	(newline)

----------------------------------------------------------

	(define kons cons)

	(define-syntax make-alist
	  (syntax-rules ()
	    ((make-alist (key val) ...)
	     (list (kons key val) ...))))
	
	(display (caar (make-alist ("cons" cons))))
	(newline)

----------------------------------------------------------

	(define kons cons)
	
	(define-syntax make-alist
	  (syntax-rules ()
	    ((make-alist (key val) ...)
	     (list (cons key val) ...))))
	
	(display (caar (make-alist ("cons" kons))))
	(newline)

----------------------------------------------------------

Chicken Version: 5.4.0 (compiled from release tarball)
OS: Alpine Linux x86_64
CC: GCC Alpine 13.2.1_git20240309 (using musl libc)
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.