TypeFunction example: ImplictConvTargets

claptrap clap at trap.com
Wed Oct 7 08:26:21 UTC 2020


On Wednesday, 7 October 2020 at 03:12:46 UTC, Adam D. Ruppe wrote:
> On Wednesday, 7 October 2020 at 01:27:17 UTC, claptrap wrote:
>> IE. Whats the learning curve like?
>
> It is hard to say right now because

No it's not :)

>
>> See the point is even even though I understand that, it took 
>> me a while to grep it, and I couldn't just rattle that off the 
>> top of my head, it'd take me a fair while to figure out how to 
>> do that. (Maybe i wouldn't even be able to on my own)
>
> That might just be because you've never seen a combination of 
> patterns like that before... and that's OK, I made up that 
> particular thing just a few hours ago. (Though it is based on 
> some ideas Andrei and I have been bouncing back and forth.)

Yeah Im not that that used to it, but the point is you have too 
work at it to see whats going on, there's two nested functions 
calls, more things passed around, more branches and recursion.

I have no problem with recursion, there's algorithms that make 
more sense as recursion, but this is not one, it's iterating over 
a list, to make it recursive you end up with 2 or 3 times more 
things going on in in order to make it work. Two functions, more 
branches, more things passed backwards and forwards, more 
construction of AliasSeq or whatever.

Just compare how much is going on in the template version vs the 
TF version.



> But with a little library refinement and some tutorials, maybe 
> it would prove to be easy to learn and to use.

I'd rather 600 lines added to the compiler so I can concentrate 
on things I have to learn, I can write less code, my code is more 
intuative and less bug prone, because im not having to bend shit 
out of shape to make it recursive.





More information about the Digitalmars-d mailing list