axiom-developer
[Top][All Lists]
Advanced

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

[Axiom-developer] getrulefunlists


From: Gabriel Dos Reis
Subject: [Axiom-developer] getrulefunlists
Date: Thu, 9 Aug 2007 18:23:43 -0500 (CDT)

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.

-- Gaby




reply via email to

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