all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* To be a list or not
@ 2007-12-28 21:20 Lennart Borgman (gmail)
  2007-12-28 21:40 ` Eric Hanchrow
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: Lennart Borgman (gmail) @ 2007-12-28 21:20 UTC (permalink / raw)
  To: Emacs Devel

The first of these complaints that it wants a list, the second says is 
is a list:

     ;; (length '(prop . val))
     ;; (listp '(prop . val))

(With Emacs 22)

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: To be a list or not
  2007-12-28 21:20 To be a list or not Lennart Borgman (gmail)
@ 2007-12-28 21:40 ` Eric Hanchrow
  2007-12-28 21:47 ` Nick Roberts
  2007-12-29 13:51 ` Richard Stallman
  2 siblings, 0 replies; 19+ messages in thread
From: Eric Hanchrow @ 2007-12-28 21:40 UTC (permalink / raw)
  To: emacs-devel


    The first of these complaints that it wants a list, the second says is
    is a list:

        ;; (length '(prop . val))
        ;; (listp '(prop . val))

    (With Emacs 22)

Well, it's working as advertised:

    listp is a built-in function in `src/data.c'.
    (listp OBJECT)

    Return t if OBJECT is a list, that is, a cons cell or nil.
    Otherwise, return nil.

Although I myself don't think that any old cons cell ought to be
considered a list either.

-- 
Like most people, I would like to use the words ''parameters''
and ''behoove'' in the same sentence, but I am not sure how.
        -- A Question for 'Ask Mister Language Person'

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: To be a list or not
  2007-12-28 21:20 To be a list or not Lennart Borgman (gmail)
  2007-12-28 21:40 ` Eric Hanchrow
@ 2007-12-28 21:47 ` Nick Roberts
  2007-12-28 23:05   ` Lennart Borgman (gmail)
  2007-12-29 13:51 ` Richard Stallman
  2 siblings, 1 reply; 19+ messages in thread
From: Nick Roberts @ 2007-12-28 21:47 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: Emacs Devel

 > The first of these complaints that it wants a list, the second says is 
 > is a list:

No it doesn't.

 >      ;; (length '(prop . val))

Debugger entered--Lisp error: (wrong-type-argument listp val)
  length((prop . val))

So it's saying that val should be a list:

(length '(prop . (val)))
2

'(prop . (val))
(prop val)

 >      ;; (listp '(prop . val))


 -- Function: length sequence
     This function returns the number of elements in SEQUENCE.  If
     SEQUENCE is a dotted list, a `wrong-type-argument' error is
     signaled.

I would start with the manual.

-- 
Nick                                           http://www.inet.net.nz/~nickrob

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: To be a list or not
  2007-12-28 21:47 ` Nick Roberts
@ 2007-12-28 23:05   ` Lennart Borgman (gmail)
  2007-12-28 23:45     ` Nick Roberts
  2007-12-29 17:49     ` Richard Stallman
  0 siblings, 2 replies; 19+ messages in thread
From: Lennart Borgman (gmail) @ 2007-12-28 23:05 UTC (permalink / raw)
  To: Nick Roberts; +Cc: Emacs Devel

Nick Roberts wrote:
>  > The first of these complaints that it wants a list, the second says is 
>  > is a list:
> 
> No it doesn't.
> 
>  >      ;; (length '(prop . val))
> 
> Debugger entered--Lisp error: (wrong-type-argument listp val)
>   length((prop . val))
> 
> So it's saying that val should be a list:
> 
> (length '(prop . (val)))
> 2
> 
> '(prop . (val))
> (prop val)
> 
>  >      ;; (listp '(prop . val))
> 
> 
>  -- Function: length sequence
>      This function returns the number of elements in SEQUENCE.  If
>      SEQUENCE is a dotted list, a `wrong-type-argument' error is
>      signaled.
> 
> I would start with the manual.


Eh, yes but (sequencep '(prop . val)) also returns t at least in my 
version of Emacs. But maybe this has been changed?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: To be a list or not
  2007-12-28 23:05   ` Lennart Borgman (gmail)
@ 2007-12-28 23:45     ` Nick Roberts
  2007-12-29  0:18       ` Lennart Borgman (gmail)
  2007-12-29 17:49     ` Richard Stallman
  1 sibling, 1 reply; 19+ messages in thread
From: Nick Roberts @ 2007-12-28 23:45 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: Emacs Devel

 > Eh, yes but (sequencep '(prop . val)) also returns t at least in my 
 > version of Emacs. But maybe this has been changed?

I don't know what point you are making but all lists are sequences, so
if listp returns t so must sequencep.

-- 
Nick                                           http://www.inet.net.nz/~nickrob

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: To be a list or not
  2007-12-28 23:45     ` Nick Roberts
@ 2007-12-29  0:18       ` Lennart Borgman (gmail)
  2007-12-29  3:35         ` Bob Rogers
  0 siblings, 1 reply; 19+ messages in thread
From: Lennart Borgman (gmail) @ 2007-12-29  0:18 UTC (permalink / raw)
  To: Nick Roberts; +Cc: Emacs Devel

Nick Roberts wrote:
 >  > Eh, yes but (sequencep '(prop . val)) also returns t at least in my
 >  > version of Emacs. But maybe this has been changed?
 >
 > I don't know what point you are making but all lists are sequences, so
 > if listp returns t so must sequencep.

You cited the following from the manual:

 >  -- Function: length sequence
 >      This function returns the number of elements in SEQUENCE.  If
 >      SEQUENCE is a dotted list, a `wrong-type-argument' error is
 >      signaled.

However (sequencp '(prop . val)) returns t.

What I wanted to know was the recommended way to check if something is a 
cons cell, but not a sequence, ie something like '(prop . val).

Thanks for the pointer to the manual.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: To be a list or not
  2007-12-29  0:18       ` Lennart Borgman (gmail)
@ 2007-12-29  3:35         ` Bob Rogers
  2007-12-29 21:11           ` Stephen J. Turnbull
  0 siblings, 1 reply; 19+ messages in thread
From: Bob Rogers @ 2007-12-29  3:35 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: Emacs Devel

   From: "Lennart Borgman (gmail)" <lennart.borgman@gmail.com>
   Date: Sat, 29 Dec 2007 01:18:34 +0100

   . . .

   However (sequencp '(prop . val)) returns t.

   What I wanted to know was the recommended way to check if something
   is a cons cell, but not a sequence, ie something like '(prop . val).

This is called an "improper list"; you could check for it thus:

	(defun proper-list-p (x)
	  (and (listp x)
	       (null (cdr (last x)))))

But of course, this is O(N), and would not even terminate for circular
lists, which is why the predicates are designed not to go to all that
trouble.

   FWIW, format.el defines a format-proper-list-p that is equivalent.

					-- Bob Rogers
					   http://rgrjr.dyndns.org/

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: To be a list or not
  2007-12-28 21:20 To be a list or not Lennart Borgman (gmail)
  2007-12-28 21:40 ` Eric Hanchrow
  2007-12-28 21:47 ` Nick Roberts
@ 2007-12-29 13:51 ` Richard Stallman
  2007-12-29 14:30   ` Thien-Thi Nguyen
  2 siblings, 1 reply; 19+ messages in thread
From: Richard Stallman @ 2007-12-29 13:51 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: emacs-devel

    The first of these complaints that it wants a list, the second says is 
    is a list:

	 ;; (length '(prop . val))

It says that `val' is not a list.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: To be a list or not
  2007-12-29 13:51 ` Richard Stallman
@ 2007-12-29 14:30   ` Thien-Thi Nguyen
  0 siblings, 0 replies; 19+ messages in thread
From: Thien-Thi Nguyen @ 2007-12-29 14:30 UTC (permalink / raw)
  To: emacs-devel

() Richard Stallman <rms@gnu.org>
() Sat, 29 Dec 2007 08:51:34 -0500

       The first of these complaints that it wants a list,

            ;; (length '(prop . val))

   It says that `val' is not a list.

read in L->R the orig. paren taunts:
"structure consistent", as poor function wants.
but Quality trumps all else, no use believing
the model unPerceived, the misunderstood deceiving.
poor function not so poor, maybe a little wiser:
shares news w/ company, w/ caller no miser.

thi

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: To be a list or not
  2007-12-28 23:05   ` Lennart Borgman (gmail)
  2007-12-28 23:45     ` Nick Roberts
@ 2007-12-29 17:49     ` Richard Stallman
  1 sibling, 0 replies; 19+ messages in thread
From: Richard Stallman @ 2007-12-29 17:49 UTC (permalink / raw)
  To: Lennart Borgman (gmail); +Cc: nickrob, emacs-devel

    Eh, yes but (sequencep '(prop . val)) also returns t at least in my 
    version of Emacs. But maybe this has been changed?

In a strict sense, that is not a sequence.  So ideally `sequencep'
should return nil.

However, making it return nil would require changing it from a
constant-time function to a linear-time function, and that seems like
a bad idea overall.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: To be a list or not
  2007-12-29  3:35         ` Bob Rogers
@ 2007-12-29 21:11           ` Stephen J. Turnbull
  2007-12-29 22:40             ` Miles Bader
  2007-12-29 22:44             ` Tom Tromey
  0 siblings, 2 replies; 19+ messages in thread
From: Stephen J. Turnbull @ 2007-12-29 21:11 UTC (permalink / raw)
  To: Bob Rogers; +Cc: Lennart Borgman (gmail), Emacs Devel

Bob Rogers writes:

 > This is called an "improper list"; you could check for it thus:
 > 
 > 	(defun proper-list-p (x)
 > 	  (and (listp x)
 > 	       (null (cdr (last x)))))

But please call it `true-list-p', which is the name of the similar
XEmacs built-in.  The XEmacs built-in uses a tortoise-hare algorithm
to ensure that cyclic lists are caught.  I don't know who may have
touched it so I won't post code here.

As several people have pointed out, it's still O(n).  In most cases it
make a lot more sense to use a condition-case around your list-
processing code and handle the error thrown appropriately only for the
last cons.

`true-list-p' is a built-in function
  -- loaded from "/playpen/src/XEmacs/git-integration/src/data.c"
(true-list-p OBJECT)

Documentation:
Return t if OBJECT is an acyclic, nil-terminated (ie, not dotted), list.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: To be a list or not
  2007-12-29 21:11           ` Stephen J. Turnbull
@ 2007-12-29 22:40             ` Miles Bader
  2007-12-29 22:44             ` Tom Tromey
  1 sibling, 0 replies; 19+ messages in thread
From: Miles Bader @ 2007-12-29 22:40 UTC (permalink / raw)
  To: Stephen J. Turnbull; +Cc: Lennart Borgman (gmail), Bob Rogers, Emacs Devel

"Stephen J. Turnbull" <stephen@xemacs.org> writes:
>  > 	(defun proper-list-p (x)
>  > 	  (and (listp x)
>  > 	       (null (cdr (last x)))))
>
> But please call it `true-list-p', which is the name of the similar
> XEmacs built-in.

I think "proper" is the commonly used terminology though...

-Miles

-- 
Ich bin ein Virus. Mach' mit und kopiere mich in Deine .signature.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: To be a list or not
  2007-12-29 21:11           ` Stephen J. Turnbull
  2007-12-29 22:40             ` Miles Bader
@ 2007-12-29 22:44             ` Tom Tromey
  2007-12-29 23:22               ` Andreas Schwab
                                 ` (2 more replies)
  1 sibling, 3 replies; 19+ messages in thread
From: Tom Tromey @ 2007-12-29 22:44 UTC (permalink / raw)
  To: Stephen J. Turnbull; +Cc: Lennart Borgman (gmail), Bob Rogers, Emacs Devel

>>>>> "Stephen" == Stephen J Turnbull <stephen@xemacs.org> writes:

Stephen> But please call it `true-list-p', which is the name of the
Stephen> similar XEmacs built-in.

Here's one stab at it.  This is basically lifted from safe-length.

I tested it with various inputs.

Is there an Emacs test suite?  I'd be happy to put tests there, if
there is one.

Tom

ChangeLog:
2007-12-29  Tom Tromey  <tromey@redhat.com>

	* lisp.h (Ftrue_list_p): Declare.
	* data.c (Ftrue_list_p): New function.
	(syms_of_data): Update.

Index: lisp.h
===================================================================
RCS file: /sources/emacs/emacs/src/lisp.h,v
retrieving revision 1.603
diff -u -r1.603 lisp.h
--- lisp.h	22 Nov 2007 01:01:26 -0000	1.603
+++ lisp.h	29 Dec 2007 23:10:43 -0000
@@ -2205,6 +2205,7 @@
 EXFUN (Fconsp, 1);
 EXFUN (Fatom, 1);
 EXFUN (Fnlistp, 1);
+EXFUN (Ftrue_list_p, 1);
 EXFUN (Fintegerp, 1);
 EXFUN (Fnatnump, 1);
 EXFUN (Fsymbolp, 1);
Index: data.c
===================================================================
RCS file: /sources/emacs/emacs/src/data.c,v
retrieving revision 1.287
diff -u -r1.287 data.c
--- data.c	22 Nov 2007 20:29:48 -0000	1.287
+++ data.c	29 Dec 2007 23:10:44 -0000
@@ -285,6 +285,28 @@
     return Qnil;
   return Qt;
 }
+
+DEFUN ("true-list-p", Ftrue_list_p, Strue_list_p, 1, 1, 0,
+       doc: /* Return t if OBJECT is an acyclic, nil-terminated list.  */)
+     (object)
+     Lisp_Object object;
+{
+  Lisp_Object tail, halftail;
+  int len = 0;
+
+  /* halftail is used to detect circular lists.  */
+  halftail = object;  
+  for (tail = object; CONSP (tail); tail = XCDR (tail))
+    {
+      if (EQ (tail, halftail) && len != 0)
+	return Qnil;
+      ++len;
+      if ((len & 1) == 0)
+	halftail = XCDR (halftail);
+    }
+
+  return tail == Qnil ? Qt : Qnil;
+}
 \f
 DEFUN ("symbolp", Fsymbolp, Ssymbolp, 1, 1, 0,
        doc: /* Return t if OBJECT is a symbol.  */)
@@ -3291,6 +3313,7 @@
   defsubr (&Stype_of);
   defsubr (&Slistp);
   defsubr (&Snlistp);
+  defsubr (&Strue_list_p);
   defsubr (&Sconsp);
   defsubr (&Satom);
   defsubr (&Sintegerp);

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: To be a list or not
  2007-12-29 22:44             ` Tom Tromey
@ 2007-12-29 23:22               ` Andreas Schwab
  2007-12-31 16:38                 ` Tom Tromey
  2007-12-30  0:54               ` Stephen J. Turnbull
  2007-12-30  1:37               ` Richard Stallman
  2 siblings, 1 reply; 19+ messages in thread
From: Andreas Schwab @ 2007-12-29 23:22 UTC (permalink / raw)
  To: Tom Tromey
  Cc: Bob Rogers, Stephen J. Turnbull, Lennart Borgman (gmail),
	Emacs Devel

Tom Tromey <tromey@redhat.com> writes:

> +  return tail == Qnil ? Qt : Qnil;
            NILP (tail)

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: To be a list or not
  2007-12-29 22:44             ` Tom Tromey
  2007-12-29 23:22               ` Andreas Schwab
@ 2007-12-30  0:54               ` Stephen J. Turnbull
  2007-12-30  3:52                 ` Bob Rogers
  2007-12-30  1:37               ` Richard Stallman
  2 siblings, 1 reply; 19+ messages in thread
From: Stephen J. Turnbull @ 2007-12-30  0:54 UTC (permalink / raw)
  To: Tom Tromey; +Cc: Bob Rogers, Lennart Borgman (gmail), Emacs Devel

Tom Tromey writes:
 > >>>>> "Stephen" == Stephen J Turnbull <stephen@xemacs.org> writes:
 > 
 > Stephen> But please call it `true-list-p', which is the name of the
 > Stephen> similar XEmacs built-in.
 > 
 > Here's one stab at it.  This is basically lifted from safe-length.

Looks very familiar.

XEmacs implements one change you might think about.  Specifically, it
delays starting the tortoise until the length is "long enough to
suspect circularity".  I don't know if the value chosen was tuned or
not.  As I understand it, this makes the function slightly faster for
shorter lists, slightly slows down longer true lists, and might double
the detection time for cyclical lists.

Looks like a win to me, but YMMV.

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: To be a list or not
  2007-12-29 22:44             ` Tom Tromey
  2007-12-29 23:22               ` Andreas Schwab
  2007-12-30  0:54               ` Stephen J. Turnbull
@ 2007-12-30  1:37               ` Richard Stallman
  2 siblings, 0 replies; 19+ messages in thread
From: Richard Stallman @ 2007-12-30  1:37 UTC (permalink / raw)
  To: Tom Tromey; +Cc: rogers-emacs, stephen, lennart.borgman, emacs-devel

    Is there an Emacs test suite?  I'd be happy to put tests there, if
    there is one.

No, but it would be good to start one.  Would you like to start one?

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: To be a list or not
  2007-12-30  0:54               ` Stephen J. Turnbull
@ 2007-12-30  3:52                 ` Bob Rogers
  0 siblings, 0 replies; 19+ messages in thread
From: Bob Rogers @ 2007-12-30  3:52 UTC (permalink / raw)
  To: Stephen J. Turnbull; +Cc: Tom Tromey, Lennart Borgman (gmail), Emacs Devel

   From: "Stephen J. Turnbull" <stephen@xemacs.org>
   Date: Sun, 30 Dec 2007 09:54:41 +0900

   Tom Tromey writes:
    > >>>>> "Stephen" == Stephen J Turnbull <stephen@xemacs.org> writes:
    > 
    > Stephen> But please call it `true-list-p', which is the name of the
    > Stephen> similar XEmacs built-in.
    > 
    > Here's one stab at it.  This is basically lifted from safe-length.

   Looks very familiar.

   XEmacs implements one change you might think about.  Specifically, it
   delays starting the tortoise until the length is "long enough to
   suspect circularity".  I don't know if the value chosen was tuned or
   not.  As I understand it, this makes the function slightly faster for
   shorter lists, slightly slows down longer true lists, and might double
   the detection time for cyclical lists.

   Looks like a win to me, but YMMV.

Another trick is to unroll the loop so that it follows the tortoise, as
done in the CMU Common Lisp list-length function shown below (which is
in the public domain).  If you combine both tricks, you would have two
loops, the first of which only needs to maintain a tail and a counter,
and the second only needs to maintain a tail and a tortoise.

   But it's not at all clear that this is worth all that trouble . . .

					-- Bob

------------------------------------------------------------------------
(defun list-length (list)
  "Returns the length of the given List, or Nil if the List is circular."
  (do ((n 0 (+ n 2))
       (y list (cddr y))
       (z list (cdr z)))
      (())
    (declare (fixnum n) (list y z))
    (when (endp y) (return n))
    (when (endp (cdr y)) (return (+ n 1)))
    (when (and (eq y z) (> n 0)) (return nil))))

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: To be a list or not
  2007-12-29 23:22               ` Andreas Schwab
@ 2007-12-31 16:38                 ` Tom Tromey
  2007-12-31 17:13                   ` Andreas Schwab
  0 siblings, 1 reply; 19+ messages in thread
From: Tom Tromey @ 2007-12-31 16:38 UTC (permalink / raw)
  To: Andreas Schwab
  Cc: Bob Rogers, Stephen J. Turnbull, Lennart Borgman (gmail),
	Emacs Devel

>>>>> "Andreas" == Andreas Schwab <schwab@suse.de> writes:

Andreas> Tom Tromey <tromey@redhat.com> writes:
Andreas> +  return tail == Qnil ? Qt : Qnil;
Andreas>             NILP (tail)

Thanks, I didn't know about that.  BTW I see a number of EQ(...,Qnil)
comparisons in the current code.

Here's a revised patch.

I considered Stephen's suggestion of having two loops, but I think it
probably is not worthwhile.

Tom

2007-12-31  Tom Tromey  <tromey@redhat.com>

	* lisp.h (Ftrue_list_p): Declare.
	* data.c (Ftrue_list_p): New function.
	(syms_of_data): Update.

Index: data.c
===================================================================
RCS file: /sources/emacs/emacs/src/data.c,v
retrieving revision 1.287
diff -u -r1.287 data.c
--- data.c	22 Nov 2007 20:29:48 -0000	1.287
+++ data.c	31 Dec 2007 17:04:24 -0000
@@ -285,6 +285,28 @@
     return Qnil;
   return Qt;
 }
+
+DEFUN ("true-list-p", Ftrue_list_p, Strue_list_p, 1, 1, 0,
+       doc: /* Return t if OBJECT is an acyclic, nil-terminated list.  */)
+     (object)
+     Lisp_Object object;
+{
+  Lisp_Object tail, halftail;
+  int len = 0;
+
+  /* halftail is used to detect circular lists.  */
+  halftail = object;  
+  for (tail = object; CONSP (tail); tail = XCDR (tail))
+    {
+      if (EQ (tail, halftail) && len != 0)
+	return Qnil;
+      ++len;
+      if ((len & 1) == 0)
+	halftail = XCDR (halftail);
+    }
+
+  return NILP (tail) ? Qt : Qnil;
+}
 \f
 DEFUN ("symbolp", Fsymbolp, Ssymbolp, 1, 1, 0,
        doc: /* Return t if OBJECT is a symbol.  */)
@@ -3291,6 +3313,7 @@
   defsubr (&Stype_of);
   defsubr (&Slistp);
   defsubr (&Snlistp);
+  defsubr (&Strue_list_p);
   defsubr (&Sconsp);
   defsubr (&Satom);
   defsubr (&Sintegerp);
Index: lisp.h
===================================================================
RCS file: /sources/emacs/emacs/src/lisp.h,v
retrieving revision 1.603
diff -u -r1.603 lisp.h
--- lisp.h	22 Nov 2007 01:01:26 -0000	1.603
+++ lisp.h	31 Dec 2007 17:05:52 -0000
@@ -2205,6 +2208,7 @@
 EXFUN (Fconsp, 1);
 EXFUN (Fatom, 1);
 EXFUN (Fnlistp, 1);
+EXFUN (Ftrue_list_p, 1);
 EXFUN (Fintegerp, 1);
 EXFUN (Fnatnump, 1);
 EXFUN (Fsymbolp, 1);

^ permalink raw reply	[flat|nested] 19+ messages in thread

* Re: To be a list or not
  2007-12-31 16:38                 ` Tom Tromey
@ 2007-12-31 17:13                   ` Andreas Schwab
  0 siblings, 0 replies; 19+ messages in thread
From: Andreas Schwab @ 2007-12-31 17:13 UTC (permalink / raw)
  To: Tom Tromey
  Cc: Bob Rogers, Stephen J. Turnbull, Lennart Borgman (gmail),
	Emacs Devel

Tom Tromey <tromey@redhat.com> writes:

>>>>>> "Andreas" == Andreas Schwab <schwab@suse.de> writes:
>
> Andreas> Tom Tromey <tromey@redhat.com> writes:
> Andreas> +  return tail == Qnil ? Qt : Qnil;
> Andreas>             NILP (tail)
>
> Thanks, I didn't know about that.  BTW I see a number of EQ(...,Qnil)
> comparisons in the current code.

The latter is ok, but x == Qnil will fail when Lisp_Object is a union.

Andreas.

-- 
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2007-12-31 17:13 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-28 21:20 To be a list or not Lennart Borgman (gmail)
2007-12-28 21:40 ` Eric Hanchrow
2007-12-28 21:47 ` Nick Roberts
2007-12-28 23:05   ` Lennart Borgman (gmail)
2007-12-28 23:45     ` Nick Roberts
2007-12-29  0:18       ` Lennart Borgman (gmail)
2007-12-29  3:35         ` Bob Rogers
2007-12-29 21:11           ` Stephen J. Turnbull
2007-12-29 22:40             ` Miles Bader
2007-12-29 22:44             ` Tom Tromey
2007-12-29 23:22               ` Andreas Schwab
2007-12-31 16:38                 ` Tom Tromey
2007-12-31 17:13                   ` Andreas Schwab
2007-12-30  0:54               ` Stephen J. Turnbull
2007-12-30  3:52                 ` Bob Rogers
2007-12-30  1:37               ` Richard Stallman
2007-12-29 17:49     ` Richard Stallman
2007-12-29 13:51 ` Richard Stallman
2007-12-29 14:30   ` Thien-Thi Nguyen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.