axiom-developer
[Top][All Lists]
Advanced

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

Re: [Axiom-developer] getrulefunlists


From: Gabriel Dos Reis
Subject: Re: [Axiom-developer] getrulefunlists
Date: 11 Aug 2007 12:41:02 -0500

Gabriel Dos Reis <address@hidden> writes:

| Tim --
| 
|   Yet one more.  Consider the routine GETFUNLISTS from
| src/interp/parsing.lisp:
| 
| 
| (defun getrulefunlists  (rootfun rs)
|   (let* ((metapfx (or (get rootfun 'metapfx) ""))
|          (mainfun (internl metapfx (pname rootfun)))
|          (mainfunstr (pname mainfun))
|          (flnam (internl mainfunstr "FUN"))
|          (pfx-funlist (union (cons mainfun
|                                    (if (atom (eval flnam))
|                                      nil 
|                                    (eval flnam)))
|                              (mapcar #'(lambda (x) (internl metapfx (pname 
x)))
|                                      (assocleft rs))))
|          n unpfx-funlist)
|     (set flnam pfx-funlist)
|     (if (not (lessp (setq n (length metapfx)) 0))
|         (setq unpfx-funlist
|               (mapcar #'(lambda (x) 
|                         (intern (subseq (copy-symbol (pname x)) n)))
|                     pfx-funlist)))
|     (if unpfx-funlist (list pfx-funlist unpfx-funlist))))
| 
| 
| The type checker of the SBCL compiler does not like it, saying:
| 
| ; file: /home/gdr/build/bi/src/interp/parsing.lisp
| ; in: DEFUN GETRULEFUNLISTS
| ;     (INTERN (SUBSEQ (COPY-SYMBOL (VMLISP:PNAME BOOT::X)) BOOT::N))
| ; 
| ; note: deleting unreachable code
| ; 
| ; caught WARNING:
| ;   Asserted type STRING conflicts with derived type (VALUES LIST &OPTIONAL).
| ;   See also:
| ;     The SBCL Manual, Node "Handling of Types"
| 
| 
| Indeed, if you look again at the incriminated form:
| 
|       (intern (subseq (copy-symbol (pname x)) n))
| 
| it does not make sense to me how it could possibly work -- using Common Lisp
| semantics.  Indeed, copy-symbol will return a symbol and a symbol is not 
| a sequence.  I suspect what you want to pass to SUBSEQ if actually the
| SYMBOL-NAME of the new symbol.

Fixed with this.
Installed on Axiom.silver.

-- Gaby

2007-08-11  Gabriel Dos Reis  <address@hidden>
  
        * src/interp/parsing.lisp.pamphlet (getrulefunlists): Extract the
        name of the new symbol before calling subseq.

*** src/interp/parsing.lisp.pamphlet    (revision 21589)
--- src/interp/parsing.lisp.pamphlet    (local)
*************** Symbolics read-line returns embedded new
*** 908,914 ****
      (set flnam pfx-funlist)
      (if (not (lessp (setq n (length metapfx)) 0))
          (setq unpfx-funlist
!               (mapcar #'(lambda (x) (intern (subseq (copy-symbol (pname x)) 
n)))
                         pfx-funlist)))
      (if unpfx-funlist (list pfx-funlist unpfx-funlist))))
  
--- 908,914 ----
      (set flnam pfx-funlist)
      (if (not (lessp (setq n (length metapfx)) 0))
          (setq unpfx-funlist
!               (mapcar #'(lambda (x) (intern (subseq (symbol-name (copy-symbol 
(pname x))) n)))
                         pfx-funlist)))
      (if unpfx-funlist (list pfx-funlist unpfx-funlist))))
  




reply via email to

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