I don't see how your patch solves the problem you are faced with.  What do you do the next time the name of an ecl_ function changes? You need to query the version of the API as you say, and your patch does not provide a way to do that.


On 7/23/07, Erik Huelsmann <ehuels@gmail.com> wrote:
Some months ago, the full (?) ecl api has received an ecl_ prefix
(apart from all functions which were already cl_ prefixed).

When writing FFI code with c-lines and c-inline, a developer may need
these ecl_ functions. Currently, there's no way to query which API a
file is being compiled on.

I propose to resolve this issue by pushing a new feature into
*FEATURES* at ECL startup: :PREFIXED-API. The patch below does this.

At first I thought I'd try to resolve this with a version number
increase, but then I realised I'd be pushing a feature myself, while
others can benefit from the solution when implemented this way.



Here's a patch to implement my idea:

Index: src/c/main.d
RCS file: /project/ecl/cvsroot/ecl/src/c/main.d,v
retrieving revision 1.103
diff -u -r1.103 main.d
--- src/c/main.d        3 Jun 2007 13:56:11 -0000       1.103
+++ src/c/main.d        23 Jul 2007 06:49:28 -0000
@@ -424,11 +424,12 @@
                cl_list(8, @'&optional', @'&rest', @'&key',
                        @'&aux', @'&whole', @'&environment', @'&body'));

-       features = cl_list(4,
+       features = cl_list(5,
-                          ecl_make_keyword("FFI"));
+                          ecl_make_keyword("FFI"),
+                           ecl_make_keyword("PREFIXED-API"));

#define ADD_FEATURE(name) features = CONS(ecl_make_keyword(name),features)

This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>   http://get.splunk.com/
Ecls-list mailing list