all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: "Stephen J. Turnbull" <stephen@xemacs.org>
Cc: David Kastrup <dak@gnu.org>,
	Artur Malabarba <bruce.connor.am@gmail.com>,
	emacs-devel <emacs-devel@gnu.org>
Subject: Re: Merging nth, aref, and elt.
Date: Fri, 31 Oct 2014 23:19:16 -0400	[thread overview]
Message-ID: <jwva94b7gus.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: <87bnor3eyt.fsf@uwakimon.sk.tsukuba.ac.jp> (Stephen J. Turnbull's message of "Sat, 01 Nov 2014 10:08:10 +0900")

> But note that (get not-necessarily-symbolp-obj 0) has a gotcha: for
> sequences 0 means the first object when iterating, for hashes and
> symbols it means the value of the mapping at the object which
> represents the integer 0 (which happens to be unique in Lisp).  So
> it's potentially ambiguous.

I don't see any ambiguity there: sequences are mappings from integers
to objects.  There are ambiguities tho if we try to use `get' for
everything like hash tables, array, lists, symbol properties, window
parameters, buffer-local variables, object fields, ...:
- we can't reliably distinguish a list from an alist.
- we can't reliably distinguish a defstruct object from an array.


        Stefan



  reply	other threads:[~2014-11-01  3:19 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-29 21:40 Merging nth, aref, and elt Artur Malabarba
2014-10-30  1:52 ` Stefan Monnier
2014-10-30  9:51   ` David Kastrup
2014-10-30 13:30     ` Artur Malabarba
2014-10-31 19:13       ` Stefan Monnier
2014-10-31 19:56         ` Stefan Monnier
2014-11-01  1:08           ` Stephen J. Turnbull
2014-11-01  3:19             ` Stefan Monnier [this message]
2014-12-13  4:09               ` Artur Malabarba
2014-12-14  3:57                 ` Stefan Monnier
2014-12-14 11:23                   ` Nicolas Petton
2014-12-14 13:47                     ` Stefan Monnier
2014-12-18 16:01                       ` Artur Malabarba
2014-12-18 19:12                         ` Stefan Monnier
2014-12-19  1:37                           ` Ted Zlatanov
2015-01-11 13:58                             ` Nicolas Petton
2015-01-12  5:28                               ` Stefan Monnier
2015-01-12  9:29                                 ` Nicolas Petton

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=jwva94b7gus.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=bruce.connor.am@gmail.com \
    --cc=dak@gnu.org \
    --cc=emacs-devel@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.