From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Dirk Herrmann Newsgroups: gmane.lisp.guile.devel Subject: Re: typechecking Date: Sat, 15 May 2004 11:16:34 +0200 Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <40A5DFF2.80004@dirk-herrmanns-seiten.de> References: <16486.52591.672130.224861@localhost.localdomain> <87brkwc6f7.fsf@zagadka.ping.de> <16544.2271.454230.492574@localhost.localdomain> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: sea.gmane.org 1084611079 19953 80.91.224.253 (15 May 2004 08:51:19 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 15 May 2004 08:51:19 +0000 (UTC) Cc: guile-devel@gnu.org, Marius Vollmer Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat May 15 10:51:10 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1BOusw-0003Zg-01 for ; Sat, 15 May 2004 10:51:10 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BOusi-00047z-Lb for guile-devel@m.gmane.org; Sat, 15 May 2004 04:50:56 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.34) id 1BOusI-00047m-AM for guile-devel@gnu.org; Sat, 15 May 2004 04:50:30 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.34) id 1BOurm-0003zu-Jh for guile-devel@gnu.org; Sat, 15 May 2004 04:50:29 -0400 Original-Received: from [212.227.126.189] (helo=moutng.kundenserver.de) by monty-python.gnu.org with esmtp (Exim 4.34) id 1BOurm-0003zg-8g for guile-devel@gnu.org; Sat, 15 May 2004 04:49:58 -0400 Original-Received: from [212.227.126.208] (helo=mrelayng.kundenserver.de) by moutng.kundenserver.de with esmtp (Exim 3.35 #1) id 1BOurl-0006TK-00; Sat, 15 May 2004 10:49:57 +0200 Original-Received: from [80.131.43.20] (helo=dirk-herrmanns-seiten.de) by mrelayng.kundenserver.de with asmtp (Exim 3.35 #1) id 1BOurl-0005z8-00; Sat, 15 May 2004 10:49:57 +0200 User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4.2) Gecko/20040220 X-Accept-Language: de, en Original-To: hanwen@xs4all.nl In-Reply-To: <16544.2271.454230.492574@localhost.localdomain> X-Enigmail-Version: 0.76.8.0 X-Enigmail-Supports: pgp-inline, pgp-mime X-Provags-ID: kundenserver.de abuse@kundenserver.de auth:494e3e4d1bf8dc247959c49e6f1f4215 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.4 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:3714 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:3714 Han-Wen Nienhuys wrote: > mvo@zagadka.de writes: > > > When I say "type checking" what really mean is that the compiler > > checks whether the user only uses SCM values in the way we want it > > to, like, no direct arithmetic, no direct use in conditional tests, > > only > > What's the rationale for not allowing direct use in conditional > tests? Code like the following: void f (SCM obj) { if (obj) { /* do something */ } } is almost always wrong, since what the user typically wants to check is, whether obj is SCM_BOOL_F or not: void f (SCM obj) { if (!SCM_FALSEP (obj)) { /* do something */ } } The first version, however, will compile if SCM is defined to be some pointer type. Best regards, Dirk Herrmann _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel