[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sqlite-users
Subject:    Re: [sqlite] Tcl variable substitution issue
From:       Donald Allen <donaldcallen () gmail ! com>
Date:       2014-01-27 12:35:35
Message-ID: CAPsTYbz95K15+rHPtfkj+AXeO3RB6eDOrttQnbVuOZ7Cnx63Lg () mail ! gmail ! com
[Download RAW message or body]

I apologize for not replying directly to your messages. My account on
this mailing list is not set up to send me individual messages.

Richard Hipp wrote:

You should do what you want, of course.

But this statement is surprising since SQLite is really just a TCL
extension that has "escaped" into the wild.

My response:

That is certainly true, but the genesis doesn't change the mismatch.
Tcl is an almost-typeless language and this situation requires the
specification of types to be handled correctly, but there is no way in
Tcl to express a type explicitly. So it is necessary to resort to
tricks such as the one you suggested.

This problem could have been taken care of in the Tcl API, by
providing something analogous to the typed bind functions present in
the C API, e.g.,

int sqlite3_bind_double(sqlite3_stmt*, int, double);
int sqlite3_bind_int(sqlite3_stmt*, int, int);
int sqlite3_bind_text(sqlite3_stmt*, int, const char*, int n, void(*)(void*));

But the designers of the API chose not to do this, leaving the
Three-Card Monte, at-no-time-did-my-fingers-leave-my-hand kind of
trickery you proposed a necessity now, after wasting time figuring out
why 'set x 1' doesn't get treated as an integer.
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic