From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Richard Shann Newsgroups: gmane.lisp.guile.user Subject: Re: scm_defined_p(sym, env) Date: Wed, 24 Aug 2011 21:25:21 +0100 Message-ID: <1314217521.2295.5.camel@debian2.myhost> References: Reply-To: richard.shann@virgin.net NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1314217412 26593 80.91.229.12 (24 Aug 2011 20:23:32 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 24 Aug 2011 20:23:32 +0000 (UTC) To: guile-user@gnu.org Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Wed Aug 24 22:23:29 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 1QwJyz-0006yf-5h for guile-user@m.gmane.org; Wed, 24 Aug 2011 22:23:29 +0200 Original-Received: from localhost ([::1]:45040 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwJyp-0002xF-Ms for guile-user@m.gmane.org; Wed, 24 Aug 2011 16:23:19 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:36308) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwJyk-0002vd-6m for guile-user@gnu.org; Wed, 24 Aug 2011 16:23:18 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QwJyi-0004fG-SZ for guile-user@gnu.org; Wed, 24 Aug 2011 16:23:14 -0400 Original-Received: from mtaout01-winn.ispmail.ntl.com ([81.103.221.47]:36581) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QwJyi-0004eK-Jf for guile-user@gnu.org; Wed, 24 Aug 2011 16:23:12 -0400 Original-Received: from know-smtpout-4.server.virginmedia.net ([62.254.123.2]) by mtaout01-winn.ispmail.ntl.com (InterMail vM.7.08.04.00 201-2186-134-20080326) with ESMTP id <20110824202300.EZSF2720.mtaout01-winn.ispmail.ntl.com@know-smtpout-4.server.virginmedia.net> for ; Wed, 24 Aug 2011 21:23:00 +0100 Original-Received: from [46.208.135.91] (helo=[192.168.2.3]) by know-smtpout-4.server.virginmedia.net with esmtpa (Exim 4.63) (envelope-from ) id 1QwJyW-0006MM-9x for guile-user@gnu.org; Wed, 24 Aug 2011 21:23:00 +0100 In-Reply-To: X-Mailer: Evolution 2.30.3 X-Cloudmark-Analysis: v=1.1 cv=R50lirqlHffDPPkwUlkuVa99MrvKdVWo//yz83qex8g= c=1 sm=0 a=bqaeD2Tb9gYA:10 a=F9S3lJeE8MMA:10 a=tOnwS5-cS8YA:10 a=IkcTkHD0fZMA:10 a=mDV3o1hIAAAA:8 a=8RloEfZUAAAA:8 a=A0uLRpT8nwjcRstRQQoA:9 a=o4XkCXBzOK74NFIWLZUA:7 a=QEXdDO2ut3YA:10 a=ii61gXl28gQA:10 a=O58u2wXj750A:10 a=HpAAvcLHHh0Zw7uRqdWCyQ==:117 X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 81.103.221.47 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:8735 Archived-At: Thanks for this, I see there is also scm_is_true to take care of the possibility that SCM_BOOL_T might not be a scalar type, we should be using that too. Richard On Wed, 2011-08-24 at 12:01 -0400, guile-user-request@gnu.org wrote: > > 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