Hi Mario,

Thanks for adding color and x11-colors.

I'll take a look at that stty build error and let you know what I find. I
had been running into it intermittently while testing my eggs, and at one
point it had just disappeared. I assumed that something in the upstream
foreigners egg had been changed that fixed it. But I just received the same
error message after clearing my chicken-install cache, re-installing
foreigners, and re-building the stty egg.

Digging deeper, I found that stty's issue has highlighted a mistake in the
foreigners egg.  Namely, that the `syntax-error` macro expects its first
argument to be a string; the foreigners egg is passing a symbol instead.
The attached patch to foreigners.scm adjusts this. I also noticed in
CHICKEN 6.0's version of the foreigners egg that two uses of `syntax-error`
were changed to `error`. So now I wonder if instead of my patch all
instances of `syntax-error` should become `error` instead.

Nevertheless, there is still something wrong with the stty egg, and I'll
continue digging.

-Erik

On Wed, Sep 2, 2026 at 5:01 AM Mario Domenech Goulart <[email protected]>
wrote:

> On Sun, 30 Aug 2026 16:33:29 -0600 Erik Falor via Chicken-users <
> [email protected]> wrote:
>
> > The eggs colors, x11-colors, and stty have been ported to CHICKEN 6.
> Until they arrive in the coop, you may clone them
> > from their repositories:
> >
> > https://github.com/fadein/chicken-color version 1.2
> > https://gitlab.com/erik.falor/x11-colors  version 1.2.1
> > https://github.com/fadein/chicken-stty version 0.9.1
>
> Thanks, Erik.  color and x11-colors have been added to CHICKEN 6.
> stty's installation fails with
>
> Syntax error: (stty.scm:106) in `syntax-error' - string expected
>
>         (syntax-error40 (quote define-foreign-record) "array access out of
> range" (quote term-attrs) (quote g55) NCCS)
>
> All the best.
> Mario
> --
> https://parenteses.org/mario
>


-- 
Erik Falor
--- foreigners/foreigners.scm	2026-09-02 11:41:36.454420984 -0600
+++ syntax-error-fix/foreigners.scm	2026-09-02 11:42:06.108355157 -0600
@@ -97,7 +97,7 @@
                                                    (chicken.compiler.c-backend#foreign-type-declaration
                                                     (car slot)
                                                     (->string (cadr slot)) ) ) )
-                                      ;; [else (syntax-error 'define-foreign-record
+                                      ;; [else (syntax-error "define-foreign-record"
                                       ;;                     "bad slot spec" slot)]
                                       )
                                     slots) )
@@ -139,7 +139,7 @@
                                                                       (,%fx< ,svar ,size)))
                                                  (,cvar ,var ,svar)
                                                  ;; this should signal a range exn...
-                                                 (,%syntax-error 'define-foreign-record
+                                                 (,%syntax-error "define-foreign-record"
                                                                  "array access out of range"
                                                                  ',tname ',svar ,size)))))
                                      ,@(if (null? setr)
@@ -156,7 +156,7 @@
                                                                                   (,%fx< ,svar ,size)))
                                                              (,cvar ,var ,svar ,xvar)
                                                              (,%syntax-error
-                                                              'define-foreign-record
+                                                              "define-foreign-record"
                                                               "array access out of range"
                                                               ',tname ',svar ,size))))))
                                                '() ))))
@@ -177,7 +177,7 @@
                                                    (,%foreign-lambda* ,%void ([,tname ,var] [,type ,xvar])
                                                      ,(sprintf "~A->~A = ~A;" var sname xvar))))
                                                '() ))))
-                                ;; [else (syntax-error 'define-foreign-record
+                                ;; [else (syntax-error "define-foreign-record"
                                 ;;                     "bad slot spec" slot)]
                                 )))
                         slots)))))))))

Reply via email to