From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Ted Zlatanov Newsgroups: gmane.emacs.devel Subject: Re: hash-table-{to, from}-alist Date: Tue, 25 Nov 2008 11:33:34 -0600 Organization: =?utf-8?B?0KLQtdC+0LTQvtGAINCX0LvQsNGC0LDQvdC+0LI=?= @ Cienfuegos Message-ID: <86bpw3d829.fsf@lifelogs.com> References: <863aknitfg.fsf@lifelogs.com> <20080830051807.GB9625@tomas> <86bpwe9su5.fsf@lifelogs.com> <867i6z1jo5.fsf_-_@lifelogs.com> <86ej14vhvg.fsf@lifelogs.com> <20081122054510.GA28298@tomas> <873ahkkkt5.fsf@xemacs.org> <20081122152126.GA4142@tomas> <87vdufk6do.fsf@xemacs.org> <867i6tt4yz.fsf@lifelogs.com> <87bpw4k1z6.fsf@xemacs.org> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1227634502 21363 80.91.229.12 (25 Nov 2008 17:35:02 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 25 Nov 2008 17:35:02 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Tue Nov 25 18:36:06 2008 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1L51pW-0002ey-1z for ged-emacs-devel@m.gmane.org; Tue, 25 Nov 2008 18:36:06 +0100 Original-Received: from localhost ([127.0.0.1]:53887 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L51oM-0000v4-Lo for ged-emacs-devel@m.gmane.org; Tue, 25 Nov 2008 12:34:54 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L51oH-0000tI-Qm for emacs-devel@gnu.org; Tue, 25 Nov 2008 12:34:49 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L51oF-0000sV-6a for emacs-devel@gnu.org; Tue, 25 Nov 2008 12:34:49 -0500 Original-Received: from [199.232.76.173] (port=34678 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L51oF-0000sS-1M for emacs-devel@gnu.org; Tue, 25 Nov 2008 12:34:47 -0500 Original-Received: from main.gmane.org ([80.91.229.2]:44078 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1L51oE-0005MP-Fe for emacs-devel@gnu.org; Tue, 25 Nov 2008 12:34:46 -0500 Original-Received: from list by ciao.gmane.org with local (Exim 4.43) id 1L51o8-00009Q-4i for emacs-devel@gnu.org; Tue, 25 Nov 2008 17:34:40 +0000 Original-Received: from 38.98.147.130 ([38.98.147.130]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 25 Nov 2008 17:34:40 +0000 Original-Received: from tzz by 38.98.147.130 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Tue, 25 Nov 2008 17:34:40 +0000 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 43 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 38.98.147.130 X-Face: bd.DQ~'29fIs`T_%O%C\g%6jW)yi[zuz6; d4V0`@y-~$#3P_Ng{@m+e4o<4P'#(_GJQ%TT= D}[Ep*b!\e,fBZ'j_+#"Ps?s2!4H2-Y"sx" User-Agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) Cancel-Lock: sha1:2GmTalvZLAkmuVGsebdLDVdznh4= X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:106159 Archived-At: On Tue, 25 Nov 2008 10:50:53 +0900 "Stephen J. Turnbull" wrote: SJT> Ted Zlatanov writes: >> The equality test is necessary if it was given originally (meaning, >> if it's not 'eql). I don't think we should ever omit it, even if >> it's the default value, for readability. SJT> I disagree. But it's not incompatible as long as you don't make the SJT> :test option to make-hash-table obligatory. ;-) OK, I'll make :test optional. Is size mandatory? I ask since you put it in your example, but you could have done so to illustrate parameters. >> Would this work? >> >> #s(hash-table size 2 test equal data (k1 v1) (k2 v2)) SJT> Not quite. The data field in XEmacs is a plist, and the construct SJT> above signals an error. SJT> #s(hash-table size 2 test equal data (k1 v1 k2 v2)) I'm OK with that format and it seems pretty good, since (read) can (I think) reuse the plist read syntax for the contents, so there's not much work for a simple implementation. Of course, an optimized implementation might be necessary, but a working simple solution is always a good first step. >> Finally, the size is just a hint with make-hash-table; should the (read) >> allow wrong sizes or throw an error? SJT> XEmacs allows wrong sizes. I think this makes sense, but it probably SJT> isn't deliberate (the structure-reading mechanism validates field SJT> values one at a time; I don't see a provision for cross-field SJT> consistency checks). SJT> #s(hash-table size 10 data (y y-value x x-value)) SJT> # That's fine. I'll just hard-code the size to 42 then. (kidding) Ted