emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: hash-table-{to, from}-alist


From: Stefan Monnier
Subject: Re: hash-table-{to, from}-alist
Date: Wed, 03 Dec 2008 21:05:54 -0500
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux)

> 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




reply via email to

[Prev in Thread] Current Thread [Next in Thread]