Re: datetime functions

new topic     » goto parent     » topic index » view thread      » older message » newer message

Jeremy Cowgar wrote:
> 
> Pete Stoner wrote:
> > 
> > I don't want to reopen a can of worms but I've been following the discussion
> > and must have missed where it was agreed to drop the prefix. It just seems
> > to
> > me that add() is rather ambiguous, there is already the precedent set in EU
> > for the edb commands of having a db_ prefix, so for the datetime functions
> > to
> > look integrated with the core commands I feel it should have a dt_ prefix
> > 
> 
> I don't think the functions will be ambiguous, as you can specify a namespace.
> 
> }}}
<eucode>
> include datetime.e as dt
> datetime d
> d = dt:now()
> 
> -- or
> 
> include datetime.e as datetime
> datetime d
> d = datetime:now()
> </eucode>
{{{

> 
> So, now the users can have as short or long prefix as they want. As for the
> precedence, only database.e is using prefixes vs. the hundred other functions?
> 

I know you can use a namespace, indeed for the code to be clear you would have
to and to be pedantic it actually amounts to more typing dt: is same as dt_ but
you also need the include as..
The general difference between the Database set of commands and all the others
is that they are just that, a set of related commands, so the prefix makes sense.
So since the dateTime routines are equally a set I stick to my dt_ suggestion. It
would also reduce the risk of namespace clashes without having to remember to do
the "include as" (which if you are lazy like I am you may well skip).

Don't get me wrong, I applaud your work on this, too many times in the past work
on similar standard additions has been started and got bogged down for one reason
or another, so this work is long overdue.

PeteS

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu