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

Re: true-list type specifier



	
    Date: Sun, 20 Apr 1986  10:41 EST
    From: "Scott E. Fahlman" <Fahlman@C.CS.CMU.EDU>
    To:   NGALL@BBNG.ARPA
    Subject: true-list type specifier
    In-Reply-To: Msg of 19 Apr 1986  19:11-EST from NGALL at G.BBN.COM
    Message-ID: <FAHLMAN.12200353201.BABYL@C.CS.CMU.EDU>
    
    
	(defun foo (my-list)
	  (declare (list my-list))
	  (member 'my my-list))
    
	and a compiler that has been told to turn off type-checking where
	licenced by user declarations.  One might assume that MEMBER need not
	do a LIST check on each CDR of MY-LIST.  But this is not the case, the
	above declaration merely licences the compiler to assume that MY-LIST
	is NIL or a CONS, but a type check should still be done on the CDR of
	MY-LIST (when it is a CONS), and on its CDR, etc.
    
	My question is:  How does one declare that MY-LIST is a true list?
    
    You're wrong here.  The term "list" already means what you want
    to call a "true list".  See the definition on page 26.
    
    -- Scott
    
	      --------------------
		
No, you're wrong here.  On pg. 27 it says: "The Lisp data type LIST is
taken to mean the union of the CONS and NULL data types, and therefore
encompasses both true lists and dotted lists."

So my question and proposal still stand.  Although I would not be
against redefining LIST to mean true-list and using
(OR NULL CONS) to mean true-or-dotted-list.  But this would be an
incompatible change, which might be harder to get into the language.

	-- Nick