I know that I favor [:-1], i.e. letting [x..y] work as before and having [x:y] do the sizeof(a)-y-1 for you. There were probably some good arguments against this, but I can't remember them.
/ Martin Nilsson (saturator)
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