Note how much
cleaner and eaiser to read this statement is and how it makes the
SQLite interface much closer to the underlying language.  This is,
I believe, a better way of doing binding than either the Perl or
the PHP examples given above.

The ability to implement it the way you describe depends on the extension code being able to access variables from the caller's stack frame. Being able to do that varies by language/API, but has always been trivial in TCL.

Perhaps now you better understand the purpose of the "$alpha"
named parameters in the parser!  Note that you do not have to
use the $alpha named parameter syntax.  :alpha works just as
well:

And the :method would be recommended otherwise users may not realise what is happening. The scheme hinges on the $variables not being interpretted as usual and passed literally into the called function like the difference between single and double quoting in shell scripts.

The use of $alpha would seem to work best for Perl and PHP but
perhaps :alpha would work better in Python.

Python does not have string interpolation (the Python terminology). In many languages where you say something like:

 echo "This is $day at $hour am"

In Python it would be:

 print "This is %s at %d am" % (day, hour)

Additionally getting variables from the caller's namespace is not something done easily and is heavily frowned on. The Python wrappers
really do things the "Python way".


Roger

Reply via email to