Add support for Chicken keywords

This commit is contained in:
retropikzel 2026-02-01 17:34:37 +02:00
parent 7237a51643
commit 5b1629cd7d
5 changed files with 25 additions and 19 deletions

View File

@ -35,14 +35,15 @@ uninstall:
init-venv: build
rm -rf venv
scheme-venv ${SCHEME} ${RNRS} venv
cp ${TESTFILE} venv/test.scm
cp ${TESTFILE} venv/test.sps
sed -i 's/srfi 64/srfi :64/' venv/test.sps
echo "(import (scheme base) (scheme write) (scheme read) (scheme char) (scheme file) (scheme process-context) (srfi 64) (retropikzel ${LIBRARY}))" > venv/test.scm
echo "(import (rnrs) (srfi :64) (retropikzel ${LIBRARY}))" > venv/test.sps
cat ${TESTFILE} >> venv/test.scm
cat ${TESTFILE} >> venv/test.sps
cp -r ../foreign-c/foreign venv/lib
cp -r retropikzel venv/lib/
if [ "${RNRS}" = "r7rs" ]; then ./venv/bin/snow-chibi install --always-yes srfi.64; fi
if [ "${RNRS}" = "r7rs" ]; then ./venv/bin/snow-chibi install --always-yes ${PKG}; fi
./venv/bin/akku install akku-r7rs chez-srfi
if [ "${RNRS}" = "r7rs" ]; then ./venv/bin/snow-chibi install ${PKG}; fi
if [ "${RNRS}" = "r6rs" ]; then ./venv/bin/akku install akku-r7rs chez-srfi; fi
run-test: init-venv
if [ "${RNRS}" = "r6rs" ]; then ./venv/bin/scheme-compile venv/test.sps; fi

View File

@ -1,7 +1,3 @@
(import (scheme base)
(scheme file)
(scheme write)
(retropikzel named-pipes))
(define pipe-path "/tmp/named-pipes-test")
(when (file-exists? pipe-path) (delete-file pipe-path))

View File

@ -1,6 +1,5 @@
(random-source-randomize! default-random-source)
(define (temp-name)
(random-source-randomize! default-random-source)
(let ((file (string-append "/tmp/pstk-"
(number->string (random-integer 1000))
"-"
@ -41,8 +40,14 @@
(define *use-keywords?* #t)
(define (keyword? x) #f) ;; TODO: handle keywords?
(define (keyword->string x) x)
(define (keyword? x)
(cond-expand
(chicken (chicken-keyword? x))
(else (error "Keywords not supported on this implementation"))))
(define (keyword->string x)
(cond-expand
(chicken (chicken-keyword->string x))
(else (error "Keywords not supported on this implementation"))))
(define nl (string #\newline))
@ -193,6 +198,7 @@
(improper-list->string x #t))
")"))
((eof-object? x) "#<eof>")
((keyword? x) (keyword->string x))
(else "#<unspecified>"))))
(define string-translate

View File

@ -162,5 +162,8 @@
ttk/available-themes
ttk/set-theme
ttk/style)
(cond-expand
(chicken (import (prefix (chicken keyword) chicken-)))
(else))
(include "pstk.scm"))

View File

@ -1 +1 @@
1.0.5
1.0.6