From: MON KEY <monkey@sandpframing.com>
To: emacs-devel@gnu.org
Cc: stephen@xemacs.org, miles@gnu.org
Subject: Re: symbol equality --cl-rest-- help-function-arglist member vs member* and also equal, eql, and eq
Date: Tue, 22 Dec 2009 18:57:38 -0500 [thread overview]
Message-ID: <d2afcfda0912221557iddb71e1tf52bb7f9e933d516@mail.gmail.com> (raw)
In-Reply-To: <877hsfiw8m.fsf@catnip.gol.com>
Stephen
> Apparently --cl-rest-- is an uninterned symbol. This is done so that
> the symbol cannot shadow an definition in code outside the cl-arglist
> processing module.
Miles
> It looks like `--cl-rest--' is an uninterned symbol.
> This is a good thing.
Ok, thanks to you both for explaining.
However, I'm not able to make that to jibe... still missing something
I'm sure.
I understand why there needs to be a reserved 'anonymous' symbol for the
--rest-of-cl-- e.g. --cl-rest-- and that this symbol should remain uninterned
but what I am missing on is why --cl-keys-- is converted to `cl-keys' whereas
--cl-rest-- can't/isn't in the `cl-do-arglist' function? For example,
In the following both `body' and `--cl-rest--' show as being interned whereas
the `*-wombats' aren't:
(intern-soft "body") ;=> t
(intern-soft "--cl-rest--") ;=> t
(intern-soft "scary-flying-wombats") ;=> nil
(mapatoms (lambda (x)
(when (string= (symbol-name x)
;; "body") ;=> (found body)
;; "--cl-rest--") ;=> (found --cl-rest--)
"scary-flying-wombats") ;=> nil
(prin1 `(found ,x))))
obarray)
(intern-soft "more-wombats") ;=> nil
(make-symbol "more-wombats") ;=> more-wombats
(mapatoms (lambda (x)
(when (string= (symbol-name x) "more-wombats")
(prin1 `(found ,x))))
obarray)
;=> nil
(member 'cl-keys (help-function-arglist 'reduce)) ;=> (cl-keys)
(member 'body (help-function-arglist 'unless)) ;=> (body)
(BTW Everything above was evaluated on two systems and with `emacs -Q'.
With the same results.)
Is not the the now-maybe arg/keyword acting acting in a manner similar
to &key's --cl-keys--, e.g. it
is let bound not setq'd:
(defun* 3rd-degree (q z w &key now-maybe)
(let ((3d (make-symbol "now-maybe")))
(when now-maybe
3d)))
(help-function-arglist '3rd-degree)
;=> (q z w &rest --cl-rest--)
(member 'now-maybe (help-function-arglist '3rd-degree))
;=> nil
(intern-soft "now-maybe")
;=> now-maybe
(mapatoms (lambda (x)
(when (string= (symbol-name x) "now-maybe")
(prin1 `(found ,x))))
obarray)
;=> (found now-maybe)
IOW `now-maybe' is interned directly via the let form whereas `--cl-rest--'
appears to be indirected through let via restarg in `cl-do-arglist' e.g.
(setq restarg (make-symbol "--cl-rest--")
I'm _not_ advocating a change but it would be good to understand vis a vis
Miles' admonition:
"That is a good thing."
What would be the consequences if user level keys following &rest i.e.
:mon-key0 :mon-key1
:mon-key2 _were_ to be interned directly (maybe on a partitioned
obarray) instead of
passing the buck to --cl-rest--?
Again, asked out of curiosity :)
s_P
next prev parent reply other threads:[~2009-12-22 23:57 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-12-22 1:16 symbol equality --cl-rest-- help-function-arglist member vs member* and also equal, eql, and eq MON KEY
2009-12-22 2:22 ` Miles Bader
2009-12-22 23:57 ` MON KEY [this message]
2009-12-23 8:59 ` David Kastrup
2009-12-22 2:32 ` Stephen J. Turnbull
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=d2afcfda0912221557iddb71e1tf52bb7f9e933d516@mail.gmail.com \
--to=monkey@sandpframing.com \
--cc=emacs-devel@gnu.org \
--cc=miles@gnu.org \
--cc=stephen@xemacs.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.