From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Daniel Colascione Newsgroups: gmane.emacs.devel Subject: Re: type checking for arbitrary lisp objects Date: Fri, 11 Apr 2014 12:12:14 -0700 Message-ID: <53483E8E.50406@dancol.org> References: <15888.20727.131941.21320@gargle.gargle.HOWL> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="j37Q74tb3FSlNUUlBoJgUvC6VcCwVRDqN" X-Trace: ger.gmane.org 1397243555 16062 80.91.229.3 (11 Apr 2014 19:12:35 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 11 Apr 2014 19:12:35 +0000 (UTC) To: Roland Winkler , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Fri Apr 11 21:12:30 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1WYgsF-0003Dq-HG for ged-emacs-devel@m.gmane.org; Fri, 11 Apr 2014 21:12:27 +0200 Original-Received: from localhost ([::1]:59501 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYgsF-0002mz-2r for ged-emacs-devel@m.gmane.org; Fri, 11 Apr 2014 15:12:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:57814) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYgsB-0002mj-94 for emacs-devel@gnu.org; Fri, 11 Apr 2014 15:12:24 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WYgs9-0003pQ-Va for emacs-devel@gnu.org; Fri, 11 Apr 2014 15:12:23 -0400 Original-Received: from dancol.org ([2600:3c01::f03c:91ff:fedf:adf3]:55259) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WYgs9-0003ox-OG for emacs-devel@gnu.org; Fri, 11 Apr 2014 15:12:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=dancol.org; s=x; h=Content-Type:In-Reply-To:References:Subject:To:MIME-Version:From:Date:Message-ID; bh=uYYKIvmpZhFEVos9ppj/49cdpw5jMxnHTXCJSJ8C+gE=; b=Z+IYys4YLnkQb+dhhXzCyvabwIMc50Hy8lIDauTX+vjUZQFfHEy0ObLLO+CM+L7wegI7NLRu1/egPs78afsWmpyU4xzESrNCNciDd24cVf2CQyjuaNf55A9r7eta81Omk1tmjVO1XDfHHH8NZaUWdVwHWG8rsf0h8OHDUKZbsPZVdqdsarj2eio+whivpNzKOrYPDOaPjrcqjPUaA23EwZlu4wzSDnmtxaQLxUC1KMP27GGXZblKs7rxSOM59IISfKb2WPuylqzN0fYWayKeMkzszV8odyWeI2Nj2DuNtSBnsnEjJ9zWskD+Pfd3A7Hw9/zaHFXKRS80O7LNI6Fffw==; Original-Received: from [2620:0:1cfe:a1:2b5:6dff:fe00:f9a6] by dancol.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:128) (Exim 4.82) (envelope-from ) id 1WYgs9-0000Bb-Cv; Fri, 11 Apr 2014 12:12:21 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.4.0 In-Reply-To: <15888.20727.131941.21320@gargle.gargle.HOWL> X-Enigmail-Version: 1.6 X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2600:3c01::f03c:91ff:fedf:adf3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:171403 Archived-At: This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --j37Q74tb3FSlNUUlBoJgUvC6VcCwVRDqN Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable On 04/11/2014 12:10 PM, Roland Winkler wrote: > The function bbdb-check-type performs a type checking for atomic or > compound lisp objects by comparing these objects against patterns > that use a syntax kind of similar to the :type keyword used by > defcustom (but without the extra keywords such as :tag used by > defcustom). So a typical pattern is something like the following >=20 > (vector (or string (const nil)) > (repeat string) > (repeat (vector string (repeat string) > string string)) > (repeat (cons symbol string)) > sexp) >=20 > I am just wondering: Am I here reinventing the wheel because > something similar has been developed already in some other package? > If not, could this possibly also be useful for other packages (for > example, for defining predicates used by the safe-local-variable > property)? Why not use cl-deftype? --j37Q74tb3FSlNUUlBoJgUvC6VcCwVRDqN Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.14 (GNU/Linux) Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/ iQIcBAEBAgAGBQJTSD6OAAoJEMAaIROpHW7IGBIP/1GowBQMBcV4IpKq10DmRL6E fYto+rJxC5jLRHuaUhz2aJHwHbDifTvgSvk8++bDYcM3+DLHiwORPr/pXD+aalCV P9TwemhLGy0iQPCWi6iehndowmT/xRdOOLvFpTCiRJyZz/2OW9B8XOHDQeyAI4am P08EHcoeEbyGdieoy9ycf3TzZrFl3zLVv3ts/LXer5totFMo+v/T7fp/7Y6GeDlI 2n268nyKWxqkgE/lb3kNL/N+JsaEYJ1lNUHgQssalgIPxe56e7/eX2JwKT8UPV5b bIpv3xLm5R4Hp1848VpUorGuXPKJ0X1aB2d5z3XaJfDqJns1teuGT/pGE0EA5uFI mQQDkpiagsyy2cnVA6SI4FSPIqLWq6OuPY1NVVKeAW2B3YyHT0RD+qsO+0S19VrR d/kY3/EQjynRJmTE6z/ZtqX+ZT/b8LjI0J+AR+ToBsGRkiU3bs6cGhVtJLGADChd 2UKmDVy8X8sEaYgL8Fzcn29RGBTcZI1tsseMf/V6bsnxrCl80C8wSUgxjCOvLaSP qouIT3iH7XlDelgEaJauLvuExJmbfpyFTMiN0UAuojlo4LbdUGDMAU20yTPJ4uMv peLnybOuLYAWEtkUAhmWzgDPhu1ZrRtmJb724YDEiB3njNkybbNEYX29Ry1qmw88 peNO7+8AfAEhi/7PXscg =xWR5 -----END PGP SIGNATURE----- --j37Q74tb3FSlNUUlBoJgUvC6VcCwVRDqN--