Felix now has a tiny bare bones binding to sqlite3.
No attempt is made to configure it for Windows..

The binding is mainly there to act as a driver for an experiment
making SQL a Domain Specific Sublanguage of Felix.

A couple of other small changes have been made, to the handling
of pointers. Expect some pain in this area.

Note for example some of the test code:

//////////////////
fun subscript: & &char * int -> &char = "$1[$2]";

cfun eh(void *data, int ncols, char * *values, char* *names):int =
{
  int i = 0;
  whilst i<ncols do
    print$ str names.[i] + "=" + str values.[i];
    if i<ncols-1 do print ", ";  done;
    ++i;
  done;
  println "";
  return 0;
}

void run(struct sqlite3_db_t db) {
///////////////////////

and you will see the new "C" syntax in action. You can't teach
an old skaller new tricks .. 

Notice that

        char * *

and

        & &char

and

        &ptr[char]
and

        &charp

are all the same type now. You have to put ugly spaces in
the * * because ** is Fortran exponential operator.
You have to put ugly spaces in & & because && is 
also another operator .. ;(

The callback type is:

  typedef sqlite3_exec_callback_t = 
        address * int * ptr[charp] * ptr[charp] --> int;

which this function has:

cfun eh(void *data, int ncols, char * *values, char* *names):int =

Ouch. I have to use 'cfun' here not a C declaration because
the callback really has to be a C function pointer.
[See earlier post]

This is all rather messy .. ;(


-- 
John Skaller <skaller at users dot sf dot net>
Felix, successor to C++: http://felix.sf.net

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Felix-language mailing list
Felix-language@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/felix-language

Reply via email to