Help the old man learn D

Charles Hawkins via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Fri Jun 26 07:39:04 PDT 2015


On Wednesday, 24 June 2015 at 16:21:47 UTC, weaselcat wrote:
> On Wednesday, 24 June 2015 at 07:52:10 UTC, Charles Hawkins 
> wrote:
>> On Wednesday, 24 June 2015 at 06:54:57 UTC, weaselcat wrote:
>>> On Tuesday, 23 June 2015 at 06:50:28 UTC, Charles Hawkins 
>>> wrote:
>>>> [...]
>>>
>>> you can instruct dub to use other compilers with the 
>>> --compiler option
>>> valid options include dmd,ldc,gdc,gdmd,ldmd
>> [...]
>>
>> Is there a quick way to get gdc to recognize 
>> std.experimental.logger?  I'm already spoiled by it.  Choosing 
>> between it and a backtrace is difficult.
>
> I believe it's available as a dub package albeit outdated, 
> should be roughly similar though.

Thanks.  I've changed to thread topic to "Help the old man learn 
D". :)  logger package allows those statements to compile with 
gdc although I'm now getting lots of errors saying "undefined 
identifier format" even though I'm importing std.format, but not 
all of them are being flagged.  Once I get it to where those are 
the only errors, perhaps I can figure it out.

I'm converting one of my OCaml programs and I have a class (call 
it Dispatcher) that uses callbacks.  With OCaml, it didn't matter 
if the callbacks were functions or methods but apparently D makes 
a distinction, which I can understand.  I guess this is an 
opinion question, but should I duplicate Dispatcher's register 
functions and data structures to handle both, or do I define 
global functions that call the called-back methods (there's only 
one instance of the called-back class) and pass those to 
Dispatcher?  Or is there a better way?


More information about the Digitalmars-d-learn mailing list