public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: George Barrett <bob@bob131.so>
To: Andrew Burgess <andrew.burgess@embecosm.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] guile: fix smob exports
Date: Fri, 04 Jun 2021 05:04:14 +1000	[thread overview]
Message-ID: <wpfo-zqnbpq&hv_4/pvm.0w&yk-9c&a.-riza77796fxu_svgknf@mail.bob131.so> (raw)
In-Reply-To: <20210603092254.GM2672@embecosm.com>

On Thu, Jun 03, 2021 at 10:22:54AM +0100, Andrew Burgess wrote:
> > +  SCM smob_type = scm_smob_type_class (result);
> 
> I don't know if we have a defined earliest supported version of guile,
> but I tried building again guile 2.0.14 with this patch applied and
> the build failed at the above line as scm_smob_type_class was not
> known.  Before this patch 2.0.14 would build fine.

Ouch, I forgot to even check! Sorry about that. As for an earliest supported
version, trying to build against 1.8 fails but Fedora still links against 2.0.
So 2.0 sounds about right.

This is a bit of a problem, though. Digging though the code/commit log,
options for accessing smob class values from outside libguile seems to break
down as follows:
 - <2.1.0: Export from (oop goops)
 - =2.1.0: N/A (!!!)
 - >2.1.0: scm_smob_type_class

IIUC Guile's odd minor versions are development/preview releases so the lack
of availability in the 2.1.0 case shouldn't have much impact, but it'll make
for a nice ifdef ladder.

> > +  SCM smob_type_name = scm_class_name (smob_type);
> > +  scm_define (smob_type_name, smob_type);
> 
> There's also scm_c_define which looks like it would do the same thing
> without us having to lookup the type name?  We could just pass name
> through directly.

The class name isn't the same as what gets passed to `scm_make_smob_type';
rather, the supplied name is implicitly enclosed in '<>'. Should I add a
comment saying as much?

> > +# Check that smob classes are exported properly
> 
> Missing '.' at the end here.

Ack.

> > +with_test_prefix "test exports" {
> > +    # For is-a? and <class>
> 
> Could you change this to 'Import (oop goops) for is-a? and <class>.',
> this comment really puzzled me for a while.

Sure. Reading it back, I'm not sure anyone could blame you for being confused
;)

Thanks

      reply	other threads:[~2021-06-03 19:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-19 22:27 George Barrett
2021-06-03  9:22 ` Andrew Burgess
2021-06-03 19:04   ` George Barrett [this message]

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

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

  git send-email \
    --in-reply-to='wpfo-zqnbpq&hv_4/pvm.0w&yk-9c&a.-riza77796fxu_svgknf@mail.bob131.so' \
    --to=bob@bob131.so \
    --cc=andrew.burgess@embecosm.com \
    --cc=gdb-patches@sourceware.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).