[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Guile initialization and string evaluation with C++
From: |
Nala Ginrut |
Subject: |
Re: Guile initialization and string evaluation with C++ |
Date: |
Tue, 01 Apr 2014 18:35:59 +0800 |
On Thu, 2014-03-27 at 21:03 -0700, Eduardo Acuña wrote:
>
>
> My program calls scm_boot_guile from the member function init() of the
> GuileApplication class. There is no problem passing the argc and argv
> to scm_boot_guile, however i want to pass the member function
> guileMain as the third argument of scm_boot_guile like a void function
> pointer (i can't cast the member function as a function pointer). The
> current way i'm avoiding this problem is passing as the third argument
> a function outside of the GuileApplication class, and passing the
> address of the instance of the GuileApplication as the fourth argument
> for dereferencing the object and calling the guileMain member function
> from there, so i had to make this non-member function a friend of
> GuileApplication. This method works but it doesn't seem to be a clean
> way of doing things. I'm not proficient in C++ or Guile and there
> might be a better way of initializing Guile from C++.
Sorry I can't help you on this. IMO, you don't understand why you can't
cast it as a function pointer. Maybe it's different from C?
>
> I want to be able to print the error message, but the handler_message
> function is only aviable from the throw.c file (because it is static)
> so i had to copy the code in my file. Is there a way to print the
> error messages without having to do this?
>
Why not do it in your Scheme code? Handling exception outside Scheme is
painful. You don't have to put everything to C/C++, except for
performance in some situations. In this case, I'm sure you don't have
to.
- Re: Guile initialization and string evaluation with C++,
Nala Ginrut <=