Re: New pre-processor interface added to Euphoria
- Posted by jeremy (admin) Aug 09, 2009
- 1394 views
prickle said...
Hey all. Just my two cents.
Would it be possible to make a preprocessor to make including shared librarys a bit easier? The ideal would be to pass it C-style headers with associated library names or wildcards and have it produce an include file containing define_c_* calls only for the corresponding method names used in the Euphoria code. The intention would be to make using shared libraries as easy as it is with C, and transparently cross-platform if at all possible.
Nick,
What a wonderful idea! Some great things are going to come out of this pre-processor, I know. With your idea it would be fully possible to:
// greeter.h //... // amongst the other defs in a C header file #define DEFAULT_GREETING "Hello" void say_hello(char *name); char *get_greeting(); //...
include greeter.h as greeter printf(1, "Default greeting is: %s\n", { greeter:DEFAULT_GREETING }) greeter:say_hello("World") sequence greeting = greeter:get_greeting()
i.e. using a C library such as libdspam, Iup, GTK, etc... by simply including it's .h header file. How briliant!
Jeremy