From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andreas Rottmann Newsgroups: gmane.lisp.guile.user Subject: Re: scm_defined_p(sym, env) Date: Tue, 23 Aug 2011 21:07:28 +0200 Message-ID: <87bovgaqvj.fsf@rotty.yi.org> References: <1314099404.2168.6.camel@debian2.myhost> <20110823115400.GA596@seid-online.de> <1314105991.2188.4.camel@debian2.myhost> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1314126469 22289 80.91.229.12 (23 Aug 2011 19:07:49 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 23 Aug 2011 19:07:49 +0000 (UTC) Cc: guile-user@gnu.org, rm@tuxteam.de To: richard.shann@virgin.net Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Tue Aug 23 21:07:44 2011 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QvwK7-0004s1-Ez for guile-user@m.gmane.org; Tue, 23 Aug 2011 21:07:43 +0200 Original-Received: from localhost ([::1]:33095 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvwK6-0006j1-Nm for guile-user@m.gmane.org; Tue, 23 Aug 2011 15:07:42 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:41562) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QvwK3-0006iW-NU for guile-user@gnu.org; Tue, 23 Aug 2011 15:07:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QvwK2-0003bI-DX for guile-user@gnu.org; Tue, 23 Aug 2011 15:07:39 -0400 Original-Received: from mailout-de.gmx.net ([213.165.64.23]:47305) by eggs.gnu.org with smtp (Exim 4.71) (envelope-from ) id 1QvwK1-0003ar-Un for guile-user@gnu.org; Tue, 23 Aug 2011 15:07:38 -0400 Original-Received: (qmail invoked by alias); 23 Aug 2011 19:07:34 -0000 Original-Received: from 85-127-63-7.dynamic.xdsl-line.inode.at (EHLO nathot.lan) [85.127.63.7] by mail.gmx.net (mp021) with SMTP; 23 Aug 2011 21:07:34 +0200 X-Authenticated: #3102804 X-Provags-ID: V01U2FsdGVkX1/wk15VTeXw/y25xWaL0d5i0g5zeFNM3DtIOD+a4F /299b1QJCFiZl0 Original-Received: from localhost (localhost.localdomain [127.0.0.1]) by nathot.lan (Postfix) with ESMTP id 9FCE03A68F; Tue, 23 Aug 2011 21:07:33 +0200 (CEST) Original-Received: from nathot.lan ([127.0.0.1]) by localhost (nathot.lan [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id qzgDNH0O9+Tl; Tue, 23 Aug 2011 21:07:29 +0200 (CEST) Original-Received: from delenn.lan (delenn.lan [192.168.3.11]) by nathot.lan (Postfix) with ESMTP id 0BFA13A685; Tue, 23 Aug 2011 21:07:29 +0200 (CEST) Original-Received: by delenn.lan (Postfix, from userid 1000) id B0B7B2C0086; Tue, 23 Aug 2011 21:07:28 +0200 (CEST) In-Reply-To: <1314105991.2188.4.camel@debian2.myhost> (Richard Shann's message of "Tue, 23 Aug 2011 14:26:31 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 213.165.64.23 X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: guile-user-bounces+guile-user=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.user:8731 Archived-At: Richard Shann writes: > I didn't find the SCM_UNBNDP() that you mention but since mailing the > list I stumbled on SCM_UNDEFINED and tried > if(opt==SCM_UNDEFINED) ... > and that seems to work. > IIRC, that this works is not actually guaranteed (it depends on the type of the SCM values; that type might not have defined/reasonable behavior wrt. the "==" operator, so the right way to write the above comparison would be `scm_is_eq(opt, SCM_UNDEFINED)', and incidentially, this is how SCM_UNBNDP() is defined (see libguile/tags.h, at least on Guile 2.0). > So (unless I am doing something bad) I think I am back on course - > thanks! > The idiom you used may work for you now, but may be broken at any time, or even when compiling Guile with a different configuration (search for SCM_DEBUG_TYPING_STRICTNESS in libguile/tags.h for illustration). HTH, Rotty PS: Please consider avoiding top-posts (see for instance for a rationale). -- Andreas Rottmann --