GNU bug report logs - #16520
24.3.50; cl-defstruct with :predicate option

Previous Next

Package: emacs;

Reported by: Helmut Eller <eller.helmut <at> gmail.com>

Date: Wed, 22 Jan 2014 10:08:01 UTC

Severity: normal

Found in version 24.3.50

Fixed in version 24.4

Done: Stefan Monnier <monnier <at> iro.umontreal.ca>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Stefan Monnier <monnier <at> iro.umontreal.ca>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#16520: closed (24.3.50; cl-defstruct with :predicate option)
Date: Thu, 23 Jan 2014 15:03:03 +0000
[Message part 1 (text/plain, inline)]
Your message dated Thu, 23 Jan 2014 10:02:02 -0500
with message-id <jwvppnivj89.fsf-monnier+emacsbugs <at> gnu.org>
and subject line Re: bug#16520: 24.3.50; cl-defstruct with :predicate option
has caused the debbugs.gnu.org bug report #16520,
regarding 24.3.50; cl-defstruct with :predicate option
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
16520: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=16520
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Helmut Eller <eller.helmut <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.3.50; cl-defstruct with :predicate option
Date: Wed, 22 Jan 2014 11:06:34 +0100
Compiling this code:

  (require 'cl-lib)
  (cl-defstruct (foo (:predicate foop)))
  (defun bar (x) (cl-check-type x foo))

with with:  emacs -Q -batch -f batch-byte-compile foo.el
produces this warning:

  foo.el:8:1:Warning: the function `foo-p' is not known to be defined.

and since foo-p is not defined will also lead errors at run-time when
bar is called.

Adding eval-and-compile to the structure definition avoids the problem
but it's a bug that the compiler emits a call to foo-p at all.


In GNU Emacs 24.3.50.2 (i686-pc-linux-gnu, GTK+ Version 2.24.10)
 of 2014-01-20 on ix



[Message part 3 (message/rfc822, inline)]
From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Helmut Eller <eller.helmut <at> gmail.com>
Cc: 16520-done <at> debbugs.gnu.org
Subject: Re: bug#16520: 24.3.50; cl-defstruct with :predicate option
Date: Thu, 23 Jan 2014 10:02:02 -0500
Version: 24.4

>   (cl-defstruct (foo (:predicate foop)))
>   (defun bar (x) (cl-check-type x foo))
[...]
>   foo.el:8:1:Warning: the function `foo-p' is not known to be defined.

Thanks, should be fixed now (more or less: it's an ugly hack).


        Stefan


This bug report was last modified 11 years and 168 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.