From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani Newsgroups: gmane.emacs.devel Subject: Re: Print representation of records and hash tables Date: Mon, 11 Dec 2017 21:20:13 +0000 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="001a114031ea38e88c0560171aa8" X-Trace: blaine.gmane.org 1513027261 8760 195.159.176.226 (11 Dec 2017 21:21:01 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 11 Dec 2017 21:21:01 +0000 (UTC) Cc: Emacs developers To: Tianxiang Xiong Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Dec 11 22:20:56 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eOVVQ-0001zC-M0 for ged-emacs-devel@m.gmane.org; Mon, 11 Dec 2017 22:20:56 +0100 Original-Received: from localhost ([::1]:55505 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOVVX-0004Mr-IH for ged-emacs-devel@m.gmane.org; Mon, 11 Dec 2017 16:21:03 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:33248) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1eOVUw-0004Mm-F4 for emacs-devel@gnu.org; Mon, 11 Dec 2017 16:20:27 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1eOVUv-0000jj-7l for emacs-devel@gnu.org; Mon, 11 Dec 2017 16:20:26 -0500 Original-Received: from mail-it0-x22c.google.com ([2607:f8b0:4001:c0b::22c]:38622) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1eOVUv-0000hG-0A for emacs-devel@gnu.org; Mon, 11 Dec 2017 16:20:25 -0500 Original-Received: by mail-it0-x22c.google.com with SMTP id r6so19215520itr.3 for ; Mon, 11 Dec 2017 13:20:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=DJqFYGlom6WSc32aJ3dk0vN5lpx7idLSfp0zaUYWo8g=; b=HQM82HboflkC6sMmW3ysEsE4PAEYyuqQF4pSWkrbcbDjj2to+DTyhM2czXTcrFmhcN zh9ihFSNYjbysG/o8/N8q9Tsoo/fraArkLJ1GuJofGjMYSe1db0ZMPBh9k0IUh5YXbds Sz5OdeQQyAF0Fo/KXrw6YFxvRNeyhsXSGOy71S9f53Jd+hKrwcjS1LvsR770Zaczlcfb wbIKXfRoQ9s3Pa56LRBflZmlFkNnZCw1KHdR59HZO/CstSJFhojjOSfxLIrFsQPA0AM+ L1ytTz8EIYaVrfeYrqktC2CbPTTO6jZUeWIuNEim2SbLIarsnvJwJJ9r/TBV11ioG1/9 HFEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=DJqFYGlom6WSc32aJ3dk0vN5lpx7idLSfp0zaUYWo8g=; b=nClUMUQvdPNpMWy1+HqUWIKPYGu+o42ZwOUYMcChfy00QimXqc9qZJaVsh2GO3c8EM 1b6YQ11EYIBEb2+oHQ9dooAarBWhWVB+Lz56KFLHgVkCp9MEULCVKvxDkfkzaC0T4ubS rjZz9fmJ4l20Xt6oDV1BhzR8L6fpoWK2YSMNYi+0lO0Ja4ofoyjDR5o7cbp4b+L9FeWf O4g1sHfoV26kPTN6nCqMrDtJgUYDGkc9KElEhlPydVqIGGk0/dYdQFRzrvgtWtx8pn8E UhgwN9+ZI7VTd/iyRsaZutL5gdCkB1DBrEWzMnNyBaE5moMtOKZPoEvSftdKOy6Xqo9s h0eg== X-Gm-Message-State: AKGB3mIMVDOSURtjdnfHXx3Ni5ci4ws/g11lXn7xlWs+dxRj2CwWWDgC WjVCKU3Tr5CRdD6LsA9I0UEe6MsFDUNR6miV55I= X-Google-Smtp-Source: ACJfBouvv0Li3qszFPpavfjVqeeoeiWcv2JeOdO1Haw3vHwYQvjmH1dvMQ0q7iwCo2S6MMPgO/pTrS9ZEadKF8kquqI= X-Received: by 10.107.37.141 with SMTP id l135mr2297817iol.104.1513027224003; Mon, 11 Dec 2017 13:20:24 -0800 (PST) In-Reply-To: X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4001:c0b::22c X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:220906 Archived-At: --001a114031ea38e88c0560171aa8 Content-Type: text/plain; charset="UTF-8" Tianxiang Xiong schrieb am Mo., 11. Dez. 2017 um 11:32 Uhr: > Emacs 26 introduces records, which have a print representation > > starting with `#s`, followed by a list of contents. > > This seems similar to the print representation of hash tables: > > (make-hash-table) > ;; => #s(hash-table size 65 test eql rehash-size 1.5 rehash-threshold 0.8 > data ( ...)) > > Is this merely "coincidence", or is there some deeper meaning? If not, > isn't it confusing to have two different objects w/ such similar print > representations? > Yes, it's confusing, and I'm very much against it. Interpretation of ELisp code (even compiled code) now changes in a very subtle manner depending on whether a record named `hash-table` happens to be defined or not. --001a114031ea38e88c0560171aa8 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable


Tianxi= ang Xiong <tianxiang.xiong@= gmail.com> schrieb am Mo., 11. Dez. 2017 um 11:32=C2=A0Uhr:
Emacs 26 introduces record= s, which have a print representation st= arting with `#s`, followed by a list of contents.

This s= eems similar to the print representation of hash tables:

(make-hash-table)=C2=A0
;; =3D> #s(hash-table size 65 t= est eql rehash-size 1.5 rehash-threshold 0.8 data ( ...))

Is this merely "coincidence", or is there some deeper mea= ning? If not, isn't it confusing to have two different objects w/ such = similar print representations?

= Yes, it's confusing, and I'm very much against it. Interpretation o= f ELisp code (even compiled code) now changes in a very subtle manner depen= ding on whether a record named `hash-table` happens to be defined or not.
--001a114031ea38e88c0560171aa8--