From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.user Subject: Re: Getting a type of a variable Date: Sat, 19 Jul 2008 10:53:57 +0200 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1216457884 12304 80.91.229.12 (19 Jul 2008 08:58:04 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 19 Jul 2008 08:58:04 +0000 (UTC) Cc: guile-user@gnu.org To: "Maciek Godek" Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sat Jul 19 10:58:52 2008 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1KK8HE-00076b-AT for guile-user@m.gmane.org; Sat, 19 Jul 2008 10:58:52 +0200 Original-Received: from localhost ([127.0.0.1]:38214 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KK8GK-0006QI-Mx for guile-user@m.gmane.org; Sat, 19 Jul 2008 04:57:57 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1KK8DH-0005ub-MA for guile-user@gnu.org; Sat, 19 Jul 2008 04:54:48 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1KK8D8-0005r5-3A for guile-user@gnu.org; Sat, 19 Jul 2008 04:54:45 -0400 Original-Received: from [199.232.76.173] (port=32853 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1KK8D6-0005pv-FI for guile-user@gnu.org; Sat, 19 Jul 2008 04:54:36 -0400 Original-Received: from a-sasl-fastnet.sasl.smtp.pobox.com ([207.106.133.19]:41112 helo=sasl.smtp.pobox.com) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1KK8D5-0001mJ-IE for guile-user@gnu.org; Sat, 19 Jul 2008 04:54:35 -0400 Original-Received: from localhost.localdomain (localhost [127.0.0.1]) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTP id 008713A265; Sat, 19 Jul 2008 04:54:30 -0400 (EDT) Original-Received: from unquote (148.Red-81-38-178.dynamicIP.rima-tde.net [81.38.178.148]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-sasl-fastnet.sasl.smtp.pobox.com (Postfix) with ESMTPSA id 80F723A255; Sat, 19 Jul 2008 04:54:28 -0400 (EDT) In-Reply-To: (Maciek Godek's message of "Fri, 18 Jul 2008 23:48:12 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-Pobox-Relay-ID: 4C8B6A0A-5570-11DD-A567-CE28B26B55AE-02397024!a-sasl-fastnet.pobox.com X-detected-kernel: by monty-python.gnu.org: Solaris 10 (beta) X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:6678 Archived-At: On Fri 18 Jul 2008 23:48, "Maciek Godek" writes: > Hello, > I'm looking for an efficient way to check the > type of an SCM variable. I imagine that I > could write something like: > (define (type? x) > (cond ((integer? x) 'int) > (cond ((real? x) 'double) > ... > ) (oop goops)'s `class-of' Andy -- http://wingolog.org/