From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: hash-table-{to, from}-alist Date: Wed, 03 Dec 2008 21:05:54 -0500 Message-ID: References: <863aknitfg.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> <86bpw3d829.fsf@lifelogs.com> <87k5ari5jh.fsf@xemacs.org> <86prkiiia2.fsf@lifelogs.com> <86ej0ygr5j.fsf@lifelogs.com> <861vwygpc6.fsf@lifelogs.com> <868wqzd06x.fsf@lifelogs.com> <867i6hrrh9.fsf@lifelogs.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1228356375 26131 80.91.229.12 (4 Dec 2008 02:06:15 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 4 Dec 2008 02:06:15 +0000 (UTC) Cc: emacs-devel@gnu.org To: Ted Zlatanov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Dec 04 03:07:18 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 1L83cZ-0003Op-Kx for ged-emacs-devel@m.gmane.org; Thu, 04 Dec 2008 03:07:15 +0100 Original-Received: from localhost ([127.0.0.1]:47712 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L83bO-00073F-V0 for ged-emacs-devel@m.gmane.org; Wed, 03 Dec 2008 21:06:03 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1L83bK-00071X-Ew for emacs-devel@gnu.org; Wed, 03 Dec 2008 21:05:58 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1L83bI-0006yj-Jx for emacs-devel@gnu.org; Wed, 03 Dec 2008 21:05:57 -0500 Original-Received: from [199.232.76.173] (port=49686 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1L83bI-0006yV-AE for emacs-devel@gnu.org; Wed, 03 Dec 2008 21:05:56 -0500 Original-Received: from ironport2-out.pppoe.ca ([206.248.154.182]:2512 helo=ironport2-out.teksavvy.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1L83bH-0006ls-TB for emacs-devel@gnu.org; Wed, 03 Dec 2008 21:05:56 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Ar0EABPKNknO+Jkl/2dsb2JhbACBbc8+gwGBIw X-IronPort-AV: E=Sophos;i="4.33,711,1220241600"; d="scan'208";a="30625030" Original-Received: from 206-248-153-37.dsl.teksavvy.com (HELO pastel.home) ([206.248.153.37]) by ironport2-out.teksavvy.com with ESMTP; 03 Dec 2008 21:05:55 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id B51D48BAF; Wed, 3 Dec 2008 21:05:54 -0500 (EST) In-Reply-To: <867i6hrrh9.fsf@lifelogs.com> (Ted Zlatanov's message of "Wed, 03 Dec 2008 13:25:22 -0600") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-detected-operating-system: by monty-python.gnu.org: Genre and OS details not recognized. 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:106543 Archived-At: > I took your other suggestions, except I don't pass Qnil parameters to > make-hash-table to keep things clean. I hope this version of the patch > is acceptable. Some nitpicks, see below. BTW, have you tried to delegate to some Elisp code? > + /* > + Accept extended format for hashtables (extensible to > + other types), e.g. > + #s(hash-table size 2 test equal data (k1 v1 k2 v2)) > + */ We like to avoid putting comment markers on their own line. So we'd write /* Accept extended format for hashtables (extensible to other types), e.g. #s(hash-table size 2 test equal data (k1 v1 k2 v2)) */ > + /* 2 * number of allowed keywords to make-hash-table */ We like to terminate our comments like sentences: with a sot followed by 2 spaces. > + if (!NILP (params[param_count+1])) param_count+=2; We like to put the body of the `if' on a separate line. > + data = Fplist_get (tmp, Qdata); /* this is the hashtable data */ Comments should be capitalized: /* This is the hashtable data. */ > + Lisp_Object ht = Fmake_hash_table (param_count, params); > + Lisp_Object key = Qnil; We recently decided it was OK to use ANSI C syntax for function headers, but I don't think ANSI C allows such variable declarations in the middle of a block. So we should probably move the delcaration of those 2 vars higher up, or open up a new block. Other than that, it looks good. Stefan