Programming for std.log

Jose Armando Garcia jsancio at gmail.com
Sun Feb 12 12:18:02 PST 2012


Hey all,

>From my experience implementing std.log and trying to keep it up to
date with commits to Phobos. I think I have become fairly frustrated
with writing D programs and debugging D program compilations
(specially templates). I swear that feels like every other commit
breaks the std.log module. This is the latest one:

std/format.d(782): Error: template std.algorithm.startsWith(alias pred
= "a == b",Range,Ranges...) if (isInputRange!(Range) && Ranges.length
> 1 && is(typeof(.startsWith!(pred)(doesThisStart,withOneOfThese[0]))
: bool) && is(typeof(.startsWith!(pred)(doesThisStart,withOneOfThese[1..__dollar]))
: uint)) does not match any function template declaration
std/format.d(782): Error: template std.algorithm.startsWith(alias pred
= "a == b",Range,Ranges...) if (isInputRange!(Range) && Ranges.length
> 1 && is(typeof(.startsWith!(pred)(doesThisStart,withOneOfThese[0]))
: bool) && is(typeof(.startsWith!(pred)(doesThisStart,withOneOfThese[1..__dollar]))
: uint)) cannot deduce template function from argument types
!()(const(char)[],char)

How am I suppose to know what is wrong with std.log base on the
information above in a 3000 line implementation? I don't even include
std.format (as that template could have been instantiated from
somewhere else). Having a lot of "experience" trying to solve this
kind of problem, I normally remove all my imports and try add the
symbols one at a time until I figure out what is wrong. This time I
honestly think that I am stumped! I know that this is not a lot of
information and I don't expect help resolving this problem but I hint
this issues with the following imports:

import core.sync.rwmutex: ReadWriteMutex;
import std.datetime: SysTime;
import std.array: Appender;

Is there anyway that dmd can tell me why a template is being
instantiated? Something like like:

template foo instantiated from std/log.d(###)
template bar instantiated from std/datetime.d(###)
template startsWith instantiated from std/format.d(###) ...

Thanks. Hopefully I'll figure this out sooner rather than later,
-Jose


More information about the Digitalmars-d mailing list