H. William Welliver III wrote:
True, but the code that handles that case isn't very complex, so why create a potential compat problem? What's the benefit?
The benefit is that I can mold Sql.Sql() into keeping the seemingly identical interface as before, except that it now inherits directly.
I.e. picture this: class Sql.SQL { string quote(string s) { return replace(s,"'","''");} array query(...) { ... } void reload() { } } class Sql.Mysql { ... as usual ... }
Then running:
object db = Sql.Sql("mysql://....");
will return an object that is of type:
class { inherit Sql.SQL; inherit Sql.Mysql; };
Whereas all the functions present in the actual backend will be immediately available to the program (no arcane indirection through master_sql anymore). But it also implies that if a backend implements a big_query(), then it must return the same type of object (i.e. not an array). If a backend wants to return an array for big_query, then it should not implement big_query at all, and just supply query (or use the array-to-object wrapper).