The best proposal I've seen so far is to import the LPC syntax, e.g. foo[..<2].
/ Martin Stjernholm, Roxen IS
Previous text:
2004-01-21 02:00: Subject: Sql interface
Is there anything deterministic about what Sql.Sql->create() throws? I just added this to AIDOs startup to autocreate a database, and I'm not overly pleased with it:
mixed err = catch { sql = objectp(url)?url:Sql.Sql( url ); };
//FIXME: Very crude, but works for the normal sqlurl case. if(err && !objectp(url)) { string baseurl = reverse(reverse(url/"/")[1..])*"/"; string dbname = (url/"/")[-1]; werror( "NOTE: Trying to create database %O\n", dbname ); Sql.Sql( baseurl ) ->query( "CREATE DATABASE IF NOT EXISTS "+ dbname ); } else if(err) { werror("FATAL: Could not connect to local media database!\n"); //FIXME: Just letting this through results in a unfriendly backtrace. }
sql = objectp(url)?url:Sql.Sql( url );
To keep things on topic: What was the result of the latest discusion about how to write ranges ending before the last index? [..-1]...
/ Peter Bortas