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: Matt Kaufmann
Subject: Re: [Gcl-devel] another GCL 2.6.9 bug?
Date: Tue, 10 Sep 2013 12:32:35 -0500

Hi, Camm --

Thanks for looking into the -f option, and for the offer to have it
cause reading from standard input.

What I'd really like, though, is a way to suppress the banner.  ACL2
starts up in its own read-eval-print loop, and 2.6.9 doesn't print the
banner till that loop is exited.  If I could suppress the banner, then
I could take advantage of si::*system-banner* and
(si::default-system-banner) to manage the printing myself.

Perhaps if -f is given "/dev/null", that could be a special indicator
to suppress the banner but not actually read from a file.  What do you
think?

Thanks --
-- Matt
   From: Camm Maguire <address@hidden>
   Date: Tue, 10 Sep 2013 10:44:45 -0400

   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]