October 24, 2012
On 10/24/2012 09:41 PM, Mehrdad wrote:
> ...
> So you can't really write a real program in D, to put it blunty.

Yes I can.
October 24, 2012
On Wednesday, 24 October 2012 at 22:00:27 UTC, Timon Gehr wrote:
> On 10/24/2012 09:41 PM, Mehrdad wrote:
>> ...
>> So you can't really write a real program in D, to put it blunty.
>
> Yes I can.

So you made your own AA and Set implementations instead of trying to use Photos?
Or did you never run into these problems?
October 24, 2012
On Wednesday, 24 October 2012 at 21:55:11 UTC, Timon Gehr wrote:
> On 10/24/2012 10:16 PM, Mehrdad wrote:
>> ...
>>
>> Maybe you can fill in the blanks?
>>
>>
>
> import std.stdio;
> struct Set(T){
>     int[T] dict;
>     hash_t toHash() const{
>         typeof(return) r = 0;
>         foreach(item; this.dict.keys){
>             r+=typeid(T).getHash(&item);
>         }
>         return r;
>     }
> }

I'm on my phone so I can't test it right now, but I'm wondering how that would possibly work correctly for Tuples and such?
October 25, 2012
On Wednesday, 24 October 2012 at 21:55:53 UTC, Era Scarecrow wrote:
> On Wednesday, 24 October 2012 at 19:41:42 UTC, Mehrdad wrote:
>> So you can't really write a real program in D, to put it blunty.
>
>  So should I drop a project I'm working on and go to C++? That isn't something I look forward to doing...

Well if it's been working for you then there's obviously no reason to. :)

I couldn't say the same thing, though.
October 25, 2012
On 10/24/12 8:53 PM, Mehrdad wrote:
> On Wednesday, 24 October 2012 at 21:55:53 UTC, Era Scarecrow wrote:
>> On Wednesday, 24 October 2012 at 19:41:42 UTC, Mehrdad wrote:
>>> So you can't really write a real program in D, to put it blunty.
>>
>> So should I drop a project I'm working on and go to C++? That isn't
>> something I look forward to doing...
>
> Well if it's been working for you then there's obviously no reason to. :)
>
> I couldn't say the same thing, though.

OK let's stop this. There's a bug that needs fixing, is all.

Andrei
October 25, 2012
On Thursday, 25 October 2012 at 00:53:31 UTC, Mehrdad wrote:
> On Wednesday, 24 October 2012 at 21:55:53 UTC, Era Scarecrow
>> So should I drop a project I'm working on and go to C++? That isn't something I look forward to doing...
>
> Well if it's been working for you then there's obviously no reason to. :)
>
> I couldn't say the same thing, though.

 You can always work around what does and doesn't work; Although preferably you shouldn't have to.

 I can only think that the best way to support the D language is simply to use it. If there's several programs that really get attention that shows the flexibility and use of D then it's more likely to be used. My biggest obstacle(s) right now is time & memory. With new issues coming up it makes you think in different directions, which all makes sense once you look for them.
October 25, 2012
On 10/25/2012 12:22 AM, Mehrdad wrote:
> On Wednesday, 24 October 2012 at 22:00:27 UTC, Timon Gehr wrote:
>> On 10/24/2012 09:41 PM, Mehrdad wrote:
>>> ...
>>> So you can't really write a real program in D, to put it blunty.
>>
>> Yes I can.
>
> So you made your own AA and Set implementations instead of trying to use
> Photos?

I have written a custom hash map.

> Or did you never run into these problems?

It is actually hard to miss them.
October 25, 2012
On Thursday, 25 October 2012 at 01:01:10 UTC, Andrei Alexandrescu wrote:
> OK let's stop this. There's a bug that needs fixing, is all.
>
> Andrei

Sorry, yeah. It was just that I came across it so much that I wanted to put it on the radar here, to let you guys know what sorts of problems you'd run into when you try using D.
It was meant to be honest feedback, that's all... I realize it was negative hopefully it was at least constructive.



Any opinions on my proposed "fixed" version, which used .tupleof?
October 25, 2012
On Thursday, 25 October 2012 at 01:36:00 UTC, Era Scarecrow wrote:
> On Thursday, 25 October 2012 at 00:53:31 UTC, Mehrdad wrote:
>> On Wednesday, 24 October 2012 at 21:55:53 UTC, Era Scarecrow
>>> So should I drop a project I'm working on and go to C++? That isn't something I look forward to doing...
>>
>> Well if it's been working for you then there's obviously no reason to. :)
>>
>> I couldn't say the same thing, though.
>
>  You can always work around what does and doesn't work; Although preferably you shouldn't have to.




Well I mean, yeah, you can obviously implement your own data structures, and eventually, your own version of Phobos, even.

The trouble is, then you're fighting the framework, and nothing integrates with anything else. Some data structure expects a toHash() instance method, another expects .hashOf, another getHash(), another getHashCode(), another might say hashCode(), and yet another might just expect a template specialization, like in C++.

So the point is, yes, it's possible. It's not that I can't work around it, but it defeats the whole purpose of switching to D.
October 25, 2012
On Thursday, 25 October 2012 at 01:50:05 UTC, Mehrdad wrote:
> Well I mean, yeah, you can obviously implement your own data structures, and eventually, your own version of Phobos, even.
>
> The trouble is, then you're fighting the framework, and nothing integrates with anything else. Some data structure expects a toHash() instance method, another expects .hashOf, another getHash(), another getHashCode(), another might say hashCode(), and yet another might just expect a template specialization, like in C++.
>
> So the point is, yes, it's possible. It's not that I can't work around it, but it defeats the whole purpose of switching to D.


 I have no intention of writing a different version of phobos or breaking the framework. I'll work within the framework as much as possible; Working around the issues usually ends up force casting something so you can get the job done (but you still need to honor the type's original contract).

 I'll just hope my data processing won't require anything that's broken or going to be depreciated, I've already dropped using std.stream for ranges instead. Dropping classes in favor of structs.