More octal questions

Jonathan M Davis jmdavisProg at gmx.com
Wed Feb 15 08:41:33 PST 2012


On Wednesday, February 15, 2012 08:32:55 H. S. Teoh wrote:
> On Wed, Feb 15, 2012 at 02:42:04PM +0100, Timon Gehr wrote:
> > On 02/15/2012 09:30 AM, Andrej Mitrovic wrote:
> > >Where do you see those literals? I'm only seeing strings.
> > 
> > Line 8322:
> > _assertPred!"=="(SysTime.fromISOString("20101222T172201"),
> > SysTime(DateTime(2010, 12, 22, 17, 22, 01)));
> 
> That unittest contains a lot of these literals. I'm not sure if this is
> leftover from older code?

They're not left over at all, and they have nothing to do with octal. It's 
simply a matter of the natural thing for me to do when dealing with dates and 
times is to put the 0 in front of single digit numbers. You'll note that in 
the string representations, you _have_ to (per the ISO standard). So, I ended 
up doing it with the integer literals without thinking about it.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list