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: Fri, 31 Jul 2009 15:03:48 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.50 (gnu/linux)

SM> Of, course there's always another (more reliable) way:
SM> (hash-table-p (read-from-string (prin1-to-string (make-hash-table))))
> That was my first thought, but it seemed like a really hacky approach
> when featurep exists.

It's definitely not hacky.  It's more reliable (tho it probably requires
a bit of fiddling such as wrapping it in ignore-errors) and tests more
directly the presence of the feature you need.

The advantage of the featurep call is that it's likely to be
more efficient (which only matters if the test is made within a loop,
of course).


        Stefan




reply via email to

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