axiom-developer
[Top][All Lists]
Advanced

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

Re: [Axiom-developer] vmlisp


From: Gabriel Dos Reis
Subject: Re: [Axiom-developer] vmlisp
Date: 14 May 2007 02:05:36 -0500

Gabriel Dos Reis <address@hidden> writes:

[...]

| The motivation of moving VMLISP to BOOT is not that we have too many
| packages. This has nothing to do with Lisp package mehcanism.
| The motivation for merging both is that we end up with codes that
| do not know where to pick their symbols from, duplicate definitions in 
| both packages, and more confusion.  Codes that are so tied should be in one
| logical unit.

I realize the above statements may sound very abstract to many.  So,
let me give an example.

Take the following fragment, at the scope of package BOOT, from
src/interp/setq.lisp: 

    (SETQ ERRORINSTREAM (DEFIOSTREAM
       '((DEVICE . CONSOLE) (MODE . INPUT) (QUAL . T)) 133 1))

    (SETQ ERROROUTSTREAM
     (DEFIOSTREAM '((DEVICE . CONSOLE)(MODE . OUTPUT)) 80 0) )

    (SETQ |$algebraOutputStream|
     (DEFIOSTREAM '((DEVICE . CONSOLE)(MODE . OUTPUT)) 255 0) )


First let me observe that, in reality they are not needed, and I don't
think they actually work as expected.

In the above fragment, DEFIOSTREAM is a helper function defined in
package VMLISP (from src/interp/vmlisp.lisp):

   (defun DEFIOSTREAM (stream-alist buffer-size char-position)
    (declare (ignore buffer-size))
      (let ((mode (or (cdr (assoc 'MODE stream-alist)) 'INPUT))
            (filename (cdr (assoc 'FILE stream-alist)))
            (dev (cdr (assoc 'DEVICE stream-alist))))
         (if (EQ dev 'CONSOLE) (make-synonym-stream '*terminal-io*)
           (let ((strm (case mode
                             ((OUTPUT O) (open (make-filename filename)
                                               :direction :output))
                             ((INPUT I) (open (make-input-filename filename)
                                              :direction :input)))))
             (if (and (numberp char-position) (> char-position 0))
                 (file-position strm char-position))
             strm))))


*If* everything goes well the variables ERRORINSTREAM, ERROROUTSTREAM,
and |$algebraOutputStream| should be alias for *terminal-io*.  For
that to work, there ought to be that the symbols CONSOLE from packages
VMLISP (where the function DEFIOSTREAM is defined) and package BOOT
(where DEFIOSTREAM is called from) are EQ.  They not EQ.


-- Gaby




reply via email to

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