unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: Bruce Korb <bkorb@veritas.com>
Cc: guile-devel@gnu.org
Subject: Re: How do I determine the argument type...
Date: Sun, 18 May 2003 18:44:35 -0700	[thread overview]
Message-ID: <3EC83703.B878986D@veritas.com> (raw)
In-Reply-To: 87addjwymo.fsf@zip.com.au

Kevin Ryde wrote:
> 
> Bruce Korb <bkorb@veritas.com> 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


  reply	other threads:[~2003-05-19  1:44 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-05-10  3:27 How do I determine the argument type Bruce Korb
2003-05-10  3:31 ` Bruce Korb
2003-05-17 20:14 ` Marius Vollmer
2003-05-17 21:16   ` Bruce Korb
2003-05-18  1:57     ` Marius Vollmer
2003-05-18  2:59       ` Bruce Korb
2003-05-19  0:07       ` Kevin Ryde
2003-05-19  0:34         ` Bruce Korb
2003-05-19  0:47           ` Kevin Ryde
2003-05-19  1:44             ` Bruce Korb [this message]
2003-06-01 18:45         ` Marius Vollmer
2003-06-01 20:07           ` Bruce Korb
2003-06-11 22:33           ` Kevin Ryde

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=3EC83703.B878986D@veritas.com \
    --to=bkorb@veritas.com \
    --cc=guile-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).