Patch to make foreigners egg work in CHICKEN 6

"Diego A. Mundo via Chicken-users" <[email protected]> Sun, 30 Nov 2025 21:48:27 +0000
Newsgroups gmane.lisp.scheme.chicken
Message-ID <-xyipm6eWiGNHGWQ1mQ8-XkqyWbH-RWKby2wyusPPDAMtqfbm_aINCMMpnLPjDf5WQMfhcgTVPAPIFt5SEdxXuvFAgkTJvGe5_CGfs5FzGo=@pm.me>
This is a trivial patch to get foreigners working on CHICKEN 6. The only change is calling error instead of syntax-error in a couple places.

Diego
foreigners.patch (text/x-patch, 1.4 KB)
--- /home/dieggsy/.cache/basket/chicken-install/5.4.0/foreigners/foreigners.scm	2025-11-22 09:05:53.381438357 -0500
+++ /home/dieggsy/.cache/basket/chicken-install/5.4.0/foreigners6/foreigners.scm	2025-11-22 09:10:06.904376407 -0500
@@ -64,9 +64,10 @@
             (let ((decl (caar slts)))
               (cond ((c decl (r #:constructor)) (set! ctor (cadar slts)))
                     ((c decl (r #:destructor)) (set! dtor (cadar slts)))
-                    (else (syntax-error 'define-foreign-record-type
-                                        "invalid foreign record-type declaration" (car slts))) )) )
-        
+                    (else
+                     (error 'define-foreign-record-type
+                            "invalid foreign record-type declaration" (car slts))))))
+
           (chicken.compiler.support#register-foreign-type! tname `(c-pointer ,fname))
 
           (let ((%void 'void)  ; foreign-lambda* recognizes renamed type identifiers now,
@@ -208,7 +209,7 @@
                                                      "error in enum spec" spec))
                                  (s          `((,s ,s) ,s ',s))
                                  (else
-                                  (syntax-error 'default-foreign-enum-type
+                                  (error 'default-foreign-enum-type
                                          "error in enum spec" spec))))
                         enumspecs)))
         (with-renamed