From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Drew Adams" Newsgroups: gmane.emacs.devel Subject: custom type tests Date: Fri, 30 Nov 2007 17:09:23 -0800 Message-ID: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1196471438 11837 80.91.229.12 (1 Dec 2007 01:10:38 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 1 Dec 2007 01:10:38 +0000 (UTC) To: "Emacs-Devel" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sat Dec 01 02:10:45 2007 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 1IyGsT-00020c-I3 for ged-emacs-devel@m.gmane.org; Sat, 01 Dec 2007 02:10:41 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IyGsD-0002tX-KI for ged-emacs-devel@m.gmane.org; Fri, 30 Nov 2007 20:10:25 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1IyGsA-0002sV-E8 for emacs-devel@gnu.org; Fri, 30 Nov 2007 20:10:22 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1IyGs9-0002rs-Lt for emacs-devel@gnu.org; Fri, 30 Nov 2007 20:10:22 -0500 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IyGs9-0002rk-E4 for emacs-devel@gnu.org; Fri, 30 Nov 2007 20:10:21 -0500 Original-Received: from rgminet01.oracle.com ([148.87.113.118]) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1IyGs9-0002kg-6Y for emacs-devel@gnu.org; Fri, 30 Nov 2007 20:10:21 -0500 Original-Received: from agmgw2.us.oracle.com (agmgw2.us.oracle.com [152.68.180.213]) by rgminet01.oracle.com (Switch-3.2.4/Switch-3.1.6) with ESMTP id lB11AHFf005083 for ; Fri, 30 Nov 2007 18:10:18 -0700 Original-Received: from acsmt351.oracle.com (acsmt351.oracle.com [141.146.40.151]) by agmgw2.us.oracle.com (Switch-3.2.0/Switch-3.2.0) with ESMTP id lAU5TCnb026245 for ; Fri, 30 Nov 2007 18:10:17 -0700 Original-Received: from dhcp-amer-csvpn-gw1-141-144-64-192.vpn.oracle.com by acsmt350.oracle.com with ESMTP id 3400047851196471351; Fri, 30 Nov 2007 17:09:11 -0800 X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.6604 (9.0.2911.0) Importance: Normal X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.3198 X-Brightmail-Tracker: AAAAAQAAAAI= X-Brightmail-Tracker: AAAAAQAAAAI= X-Whitelist: TRUE X-Whitelist: TRUE X-detected-kernel: by monty-python.gnu.org: Linux 2.4-2.6 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:84399 Archived-At: Does anyone know of code that deals with custom types in such a way that you could test whether the type of a user option is compatible with a given type? For instance, if a variable `foo' is of type `regexp' and `bar' is of type `color', I would want a test for compatibility with type `string' to return non-nil for each, since a regexp and a color are strings. As another example, if `foo' is of type `string', I would want a test for compatibility with type (choice (const nil) string) to return non-nil, since a string is in the union of all strings and {nil}. Any existing code that deals with subtypes this way? Any code that deals with custom type tests, other than just `custom-variable-type' and (get __ 'custom-type)? I'm looking for code that would allow flexible type tests - subtyping, if possible (see above), but also not differentiating between types such as (choice (const :tag "toto" nil) string) and (choice (const nil) string) or between (choice (choice (const nil) string) and (choice string (const nil)). Any pointers to pertinent code or doc are appreciated. Think of it this way: Given a custom type, how can I find all user options that have that type (or a compatible type, such as a subtype)?