gcl-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Gcl-devel] another GCL 2.6.9 bug?


From: Camm Maguire
Subject: Re: [Gcl-devel] another GCL 2.6.9 bug?
Date: Tue, 10 Sep 2013 10:44:45 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux)

Greetings!

Matt Kaufmann <address@hidden> writes:

> Hi, Camm --
>
> I see that the startup banner is printed differently now in GCL, at
> least 2.6.9, than it used to be.  (I haven't looked into 2.6.8.)
> Specifically, when I build ACL2 the banner doesn't get printed until I
> exit that ACL2 read-eval-print loop.  I know how to fix that in GCL
> 2.6.9, but my fix doesn't work for older GCL versions (where the
> banner would be printed twice with my fix).
>
> I think the -f option is intended to suppress the startup banner, and
> that would solve my problem -- I'll just write -f into the saved_acl2
> script.  However -f seems to be broken in GCL 2.6.9:
>
> eld:~% gcl-2.6.9 -f
>
> Error: Cannot open the file NIL.
> Fast links are on: do (si::use-fast-links nil) for debugging
> Error signalled by SYSTEM:TOP-LEVEL.
> Backtrace: 
> eld:~% 
>
> Will you make -f work when you create 2.6.10?
>

Thanks for the report!

The argument handling was to support Jared's request for --.

The manpage describes -f as follows (with formatting error -- also to
fix):

       Open the file following -f for input, skip the first line,and
              then read and eval the rest of the forms in the file.
              Replaces si::*command-args* by the the list starting after
              -f. This can be used as with the shells to write small shell
              programs:

So a shell script starting with 

#!/usr/bin/gcl -f

does indeed work as advertised in 2.6.9.

I do see that in 2.6.8, gcl -f alone on the command line gave one a
bannerless prompt, and in 2.6.9 this fails as there is no filename after
the -f to open. (#! supplies the filename containing it when executed by
the kernel.)  So I have a patch here that will go in 2.6.10 if you'd
like:

gcl_top.lsp:

(defun do-f (file &aux *break-enable*)
  (catch *quit-tag*
    (labels ((read-loop (st &aux (tem (read st nil 'eof))) (when (eq tem 'eof) 
(bye)) (eval tem) (read-file st))
             (read-file (st) (read-line st) (read-loop st)))
            (if file
                (with-open-file
                 (st file)
                 (read-file st))
              (read-file *standard-input*))))
  (bye 1))

which when run gives 

./saved_pre_gcl -f
(print 'h)
(print 'h)

H (print 'h)
(print 'h)

H (print 'h)
(print 'h)

H 

Note the first line is skipped as advertised.  Is this desired?

In sum, the banner ommission is a side-effect of -f -- the intent was to
read commands from a shell script.

Take care,
-- 
Camm Maguire                                        address@hidden
==========================================================================
"The earth is but one country, and mankind its citizens."  --  Baha'u'llah



reply via email to

[Prev in Thread] Current Thread [Next in Thread]