all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Philip Kaludercic <philipk@posteo.net>
To: binarydigitz01 via Users list for the GNU Emacs text editor
	<help-gnu-emacs@gnu.org>
Subject: Re: is subrp/subr-primitive-p ever non-nil?
Date: Fri, 15 Jul 2022 10:59:21 +0000	[thread overview]
Message-ID: <87bktq1w1i.fsf@posteo.net> (raw)
In-Reply-To: <87fsj21w9l.fsf@posteo.net> (Philip Kaludercic's message of "Fri,  15 Jul 2022 10:54:30 +0000")

Philip Kaludercic <philipk@posteo.net> writes:

> Evaluating this code doesn't generate any messages at all
>
> (mapatoms
>  (lambda (sym)
>    (when (subrp sym)
>      (message "(subrp %s) => t" sym t))
                                      ^
                                      ignore this typo
>    (when (subr-primitive-p sym)
>      (message "(subr-primitive-p %s) => t" sym))))
>
> For reference, M-x emacs-version gives me
>
> GNU Emacs 29.0.50 (build 7, x86_64-pc-linux-gnu, GTK+ Version 3.24.34,
> cairo version 1.17.6) of 2022-07-13
>
> and native compilation is enabled.
>
> I am wondering if this is intentional or if it could be a bug?

Never mind, my mistake was assuming that passing the symbol would do the
job, while I actually had to use `symbol-function'.  This does what I
wanted

--8<---------------cut here---------------start------------->8---
(mapatoms
 (lambda (sym)
   (let ((func (symbol-function sym)))
     (when (subrp func)
       (message "(subrp %s) => t" sym))
     (when (subr-primitive-p func)
       (message "(subr-primitive-p %s) => t" sym)))))
--8<---------------cut here---------------end--------------->8---



      reply	other threads:[~2022-07-15 10:59 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-15 10:54 is subrp/subr-primitive-p ever non-nil? Philip Kaludercic
2022-07-15 10:59 ` Philip Kaludercic [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87bktq1w1i.fsf@posteo.net \
    --to=philipk@posteo.net \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.