Hi Elias,

The axis can be any APL value, so you can use a string or some structured context as axis argument. I believe there should still be some structure so that people can deal with different libraries. The idea of using an axis is that the axis contains information about a function while the normal left and right arguments are passed as parameters
into the function.

We could also think about passing the APL name (i.e. the right argument of ⎕FX) of the function to the function so that you can share the same library under different names in APL and every
name could call its own functions.

Regarding libraries, I have seen a strong need for that for years. But looking at the relatively small community of GNU APL (compared to commercial vendors) we need libraries that are useful also for other APL interpreters. I also think that shared libs in the form of .so files are too cumbersome to be used as libraries, I see native functions more as wrapper functions in
order to interface 2ith libraries written in other languages.

/// Jürgen


On 04/03/2014 09:43 AM, Elias Mårtenson wrote:
As previously mentioned, I'm currently hacking away at SQL integration. Like all native libraries in GNU APL, the system is accessed using a function number together with the variable that is bound in the ⎕FX call.

There are, however, two limitations that I would like to see addressed:

First of all, one might want to use more than one function since remembering the function numbers is a bit ugly. Secondly, one might not want to implement all of the functionality in C++. Parts of the code would be much better written in APL itself.

Thus, we need the following:

  * A way to load APL code packaged in a library (the APL code
    initialiser could do the necessary ⎕FX calls to load the native
    code, if such exists)
  * A way to separate symbols in different namespaces. If two
    libraries define functions or variables with the same name, there
    would be problems.

Ideally, I'd like to be able to do something like:

    )LoadWhatever 'SQLite3'
    db ← *SQLite.init* '/path/to/database'
    result ← db *SQLite.query* 'select * from foo'
    *SQLite.close* db


(the above shows what my current SQLite implementation would look like if we had these features)

The )LoadWhatever command would load APL code in a similar way as the -f flag does when starting the interpreter.

About namespaces, here's a video about them in Dyalog. It's a pretty good idea: http://www.youtube.com/watch?v=XS5Hekf9a9I

Regards,
Elias

Reply via email to