From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Bruce Korb Newsgroups: gmane.lisp.guile.devel Subject: Re: How do I determine the argument type... Date: Sun, 18 May 2003 18:44:35 -0700 Organization: Home Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Message-ID: <3EC83703.B878986D@veritas.com> References: <3EBC71BF.B2264C7@veritas.com> <874r3t5o1f.fsf@zagadka.ping.de> <3EC6A6CA.94855664@veritas.com> <87of213tk0.fsf@zagadka.ping.de> <87addjwymo.fsf@zip.com.au> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Trace: main.gmane.org 1053308360 8887 80.91.224.249 (19 May 2003 01:39:20 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Mon, 19 May 2003 01:39:20 +0000 (UTC) Cc: guile-devel@gnu.org Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Mon May 19 03:39:18 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19HZcU-0002J7-00 for ; Mon, 19 May 2003 03:39:18 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19HZdN-00073h-02 for guile-devel@m.gmane.org; Sun, 18 May 2003 21:40:13 -0400 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.10.13) id 19HZcA-0006XY-00 for guile-devel@gnu.org; Sun, 18 May 2003 21:38:58 -0400 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.10.13) id 19HZbc-0006FU-00 for guile-devel@gnu.org; Sun, 18 May 2003 21:38:26 -0400 Original-Received: from bay-bridge.veritas.com ([143.127.3.10] helo=mtvmime03.VERITAS.COM) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 19HZZN-0005H5-00 for guile-devel@gnu.org; Sun, 18 May 2003 21:36:05 -0400 Original-Received: from megami (unverified) by mtvmime03.VERITAS.COM ; Sun, 18 May 2003 18:36:23 -0700 Original-Received: from veritas.com([172.22.12.211]) (2272 bytes) by megami via sendmail with P:esmtp/R:smart_host/T:smtp (sender: ) id for ; Sun, 18 May 2003 18:36:04 -0700 (PDT) (Smail-3.2.0.101 1997-Dec-17 #15 built 2001-Aug-30) X-Mailer: Mozilla 4.8 [en] (X11; U; Linux 2.4.19-4GB i686) X-Accept-Language: en Original-To: Kevin Ryde X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Developers list for Guile, the GNU extensibility library List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: main.gmane.org gmane.lisp.guile.devel:2408 X-Report-Spam: http://spam.gmane.org/gmane.lisp.guile.devel:2408 Kevin Ryde wrote: > > Bruce Korb writes: > > > > A macro cannot hide the problem. You cannot set it back to int without > > breaking everyone who adapted to size_t. > > I was thinking of something like, > > #define gh_scm2newstr(str,lenp) \ > gh_scm2newstr_helper (str, lenp, sizeof (*lenp)) > > Not sure if all compilers will enjoy "sizeof(*NULL)" though. Certainly not. Even if it did, what would the chances of ``-Wall -Werror'' be? Nobody is responding to my real problem though, so I read some code and pieced this together as an addition for strports.c. The problem with it is that it looks very version specific (viz., wouldn't work with any version but 1.6): EXPORT SCM scm_c_eval_string_with_file_line( tCC* pzExpr, tCC* pzFile, int line ) { static const char zEx[] = "eval-string-with-file-line"; static SCM file = SCM_UNDEFINED; SCM expr = scm_makfrom0str (pzExpr); SCM port = scm_mkstrport (SCM_INUM0, expr, SCM_OPN | SCM_RDNG, zEx); SCM res; SCM_PTAB_ENTRY (port)->line_number = line - 1; if ( (file == SCM_UNDEFINED) || (strcmp(SCM_CHARS (file), pzFile) != 0) ) { file = scm_makfrom0str (pzFile); SCM_PTAB_ENTRY (port)->file_name = file; } res = scm_c_call_with_current_module( scm_interaction_environment(), inner_eval_string, (void*)port ); return res; } It seems to do what I want. _______________________________________________ Guile-devel mailing list Guile-devel@gnu.org http://mail.gnu.org/mailman/listinfo/guile-devel