This is a read-only archive of lispforum.com. The forum was locked to new users and posts and is preserved here as static HTML from a database snapshot taken on 2019-09-07.

WITH-STANDARD-IO-SYNTAX in the gcl

2 posts · 2292 views

Linux, gcl.

I read the "Practical Common Lisp" book and try to use its code. I get the problem for the next code (from the book):
(defun save-db (filename)
 (with-open-file (out filename
                   :direction :output
                   :if-exists :supersede)
    (with-standard-io-syntax
       (print *db* out))))
Result:
>(save-db "www")

Error: The function WITH-STANDARD-IO-SYNTAX is undefined.
Fast links are on: do (si::use-fast-links nil) for debugging
Error signalled by PROGN.
Broken at PROGN. Type :H for Help.
Is the WITH-STANDARD-IO-SYNTAX undefined for the gcl?

Re: WITH-STANDARD-IO-SYNTAX in the gcl

On their site, they say:
While GCL was originally designed to meet the CLtL1 standard, recent development has brought GCL much of the way toward its current goal -- full ANSI compliance. An ANSI regression test suite is being developed as part of this effort. As of the time of this writing, the new ANSI behavior is enabled optionally at compile time with the configure switch --enable-ansi.
So that's probably the cause.
cl-2dsyntax is my attempt to create a Python-like reader. My mirror of CLHS (and the dark themed version). Temporary mirrors of aferomentioned: CLHS and a dark version.