Re: Not able to load classes defined in archive file in Mac OSX using Object.factory

2018-11-16 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 16 November 2018 at 14:55:52 UTC, Aditya wrote: How can one write own factory function ? Any pointers to this ? Something like Interface delegate()[string] factories; Interface create(string className) { if(className in factories) return factories[classname]; else

Re: Not able to load classes defined in archive file in Mac OSX using Object.factory

2018-11-16 Thread Basile B. via Digitalmars-d-learn
On Friday, 16 November 2018 at 14:55:52 UTC, Aditya wrote: On Friday, 16 November 2018 at 14:30:02 UTC, Adam D. Ruppe wrote: PS object.factory sucks and I hope it is removed some day. There's no plan to do so, but I still wouldn't actually rely on it... instead, I'd write your own factory

Re: Not able to load classes defined in archive file in Mac OSX using Object.factory

2018-11-16 Thread Steven Schveighoffer via Digitalmars-d-learn
On 11/16/18 9:51 AM, Aditya wrote: On Friday, 16 November 2018 at 14:28:22 UTC, Adam D. Ruppe wrote: On Friday, 16 November 2018 at 14:24:10 UTC, Aditya wrote: ./ss/Stat.d  (defines interface named 'Stat') ./ss/Min.d   (defines class named 'Min' that implements Stat) Did you put a module

Re: Not able to load classes defined in archive file in Mac OSX using Object.factory

2018-11-16 Thread Aditya via Digitalmars-d-learn
On Friday, 16 November 2018 at 14:30:02 UTC, Adam D. Ruppe wrote: PS object.factory sucks and I hope it is removed some day. There's no plan to do so, but I still wouldn't actually rely on it... instead, I'd write your own factory function and registration system, so you control it and will

Re: Not able to load classes defined in archive file in Mac OSX using Object.factory

2018-11-16 Thread Aditya via Digitalmars-d-learn
On Friday, 16 November 2018 at 14:28:22 UTC, Adam D. Ruppe wrote: On Friday, 16 November 2018 at 14:24:10 UTC, Aditya wrote: ./ss/Stat.d (defines interface named 'Stat') ./ss/Min.d (defines class named 'Min' that implements Stat) Did you put a module declaration at the top of those files?

Re: Not able to load classes defined in archive file in Mac OSX using Object.factory

2018-11-16 Thread Adam D. Ruppe via Digitalmars-d-learn
PS object.factory sucks and I hope it is removed some day. There's no plan to do so, but I still wouldn't actually rely on it... instead, I'd write your own factory function and registration system, so you control it and will have reliability to your specific needs. but still if the factory

Re: Not able to load classes defined in archive file in Mac OSX using Object.factory

2018-11-16 Thread Adam D. Ruppe via Digitalmars-d-learn
On Friday, 16 November 2018 at 14:24:10 UTC, Aditya wrote: ./ss/Stat.d (defines interface named 'Stat') ./ss/Min.d (defines class named 'Min' that implements Stat) Did you put a module declaration at the top of those files? Like module ss.Stat; That ought to be required; the compiler