public inbox for kawa@sourceware.org
 help / color / mirror / Atom feed
From: scprotz <scprotz@gmail.com>
To: Per Bothner <per@bothner.com>
Cc: kawa@sourceware.org
Subject: Re: Missing feature or just differences with Guile for define-public
Date: Sun, 29 Jan 2017 07:35:00 -0000	[thread overview]
Message-ID: <CAB3sfF9k6MA5svMXsfkNPNZP47f-q_VK0PcUmfYfQbsKjXUeTg@mail.gmail.com> (raw)
In-Reply-To: <ecd24a9b-87ee-a49c-b80d-80af2c0608bd@bothner.com>

Thanks.  This answers my question.  I was browsing the Kawa docs and
those functions seemed very similar so I'll explore them and see if I
can use them as drop-in solutions (or decent approximations).  If I
ever get it all up and running, I'll be sure to post the results back
for others.

On Sun, Jan 29, 2017 at 11:03 AM, Per Bothner <per@bothner.com> wrote:
> On 01/28/2017 10:07 PM, scprotz wrote:
>>
>> So my guess is, from a functional point of view, 'define-public' is
>> essentially like 'extern' in C (exposing the function to the C/Gnome)
>> calls?
>>
>> I have already reviewed the C/C++ code in Aisleriot and converting it
>> from C to Java has been very easy so far (since GTK/Glib have very
>> similar counterparts in Java).  I'm just trying to figure out how I'd
>> make the functional equivalent of a 'define-public' in a Kawa program
>> so that my Java app can call it, or is everything automatically
>> exposed as part of the compiled class once compiled by Kawa  (i.e.
>> there would be a class called "api.class" and it would have a function
>> called "setFeatures"?  Again, my exposure to Kawa specifically is
>> limited at this time, so just looking for pointers.
>>
>> If all defines are exposed as class objects (methods), then just
>> changing define-public to define might be good enough
>
>
> Guile's define-public is like a combination of Kawa's define and export.
> But in Kawa export is the default - assuming there is no explicit export (or
> equivalently
> module-export).
>
> You can generally remove 'define-module', optionally replace it with
> 'module-name'.
> If you see a use-module, you can replace it with an 'import' or a 'require'.
> (This are basically the same - import is more flexible, and is
> R7RS-compatible,
> so is usually preferred.)
>
> Lots of information in https://www.gnu.org/software/kawa/Module-classes.html
> and https://www.gnu.org/software/kawa/Importing.html .
>
>> (since define-public seems to be a guile-specific thing to expose
>> functions
>> to C).
>
>
> I don't believe that is current.  My understanding it's more like 'public'
> in Java.  It not only exposes functions to C, but more importantly it
> exposes them to other modules.
>
> --
>         --Per Bothner
> per@bothner.com   http://per.bothner.com/

      reply	other threads:[~2017-01-29  7:35 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-28 12:40 scprotz
2017-01-28 23:08 ` Per Bothner
2017-01-29  6:07   ` scprotz
2017-01-29  7:04     ` Per Bothner
2017-01-29  7:35       ` scprotz [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=CAB3sfF9k6MA5svMXsfkNPNZP47f-q_VK0PcUmfYfQbsKjXUeTg@mail.gmail.com \
    --to=scprotz@gmail.com \
    --cc=kawa@sourceware.org \
    --cc=per@bothner.com \
    /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).