Hi Thom,
I've found consulting Pure's runtime.h file to be an excellent source of
information on how to pass native C types into Pure. On Linux you
should find it in /usr/include/pure or some such place. The pure_is_*
functions can retrieve C types from pure_exprs, and functions for
building lists from C arrays of various types, and from GSL matrices are
there too.
Cheers,
Alastair
Thom Jordan <
vire...@gmail.com> writes:
> Yes, that's exactly what I was looking for, thank you.
>
> I'm going to try this out now and see if I can learn how to call Pure
> functions with arrays of ints then floats from C.
> If I get stuck I may post a question or two about this.
>
> Thanks for the info !
>
> Thom
>
>
> On Monday, May 13, 2013 6:56:13 AM UTC-4, ag wrote:
>>
>> On Thu, May 9, 2013 at 12:21 AM, Thom Jordan <
vire...@gmail.com<javascript:>>
>> wrote:
>> > Is there any existing way to call Pure functions from C directly,
>> without
>> > passing strings to an interpreter?
>>
>> Yes, but in a standalone C application you'd have to call
>> __pure_main__ somewhere (in order to initialize an interpreter
>> instance), and it's also necessary to call the function indirectly
>> through the pure_funcall runtime function (which sets up a stack frame
>> for the Pure function call before actually calling the function). This
>> is described in more detail in the "Batch Compilation" section of the
>> manual, specifically:
>>
>>
http://purelang.bitbucket.org/docs/pure.html#calling-pure-functions-from-c
>>
>> Does this answer your question?
>>
>> > Also, considering you can call Faust code from Pure, and run an instance
>> of
>> > Octave embedded in Pure, could these things also be possible if Pure was
>> > being called from a C-based application?
>>
>> Yes. At least I don't see a reason why it shouldn't work.
>>
>> Best,
>> Albert
>>
>> --
>> Dr. Albert Gr"af
>> Dept. of Music-Informatics, University of Mainz, Germany
>> Email:
agg...@gmail.com <javascript:>
>> WWW:
http://www.musikinformatik.uni-mainz.de/ag
>>
>
> --
> You received this message because you are subscribed to the Google Groups "pure-lang" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to
pure-lang+...@googlegroups.com.
> To post to this group, send email to
pure...@googlegroups.com.
> Visit this group at
http://groups.google.com/group/pure-lang?hl=en.
> For more options, visit
https://groups.google.com/groups/opt_out.