from ruby to D

2015-03-31 Thread Laeeth Isharc via Digitalmars-d
I could add something for Ruby but I'm not really sure what to add. The the content for the existing languages is quite different compared with each other. Often one doesn't know what one wants to write till one starts. I guess the focus will be different coming from Ruby than coming from

Re: from ruby to D

2015-03-31 Thread Jacob Carlborg via Digitalmars-d
On 2015-03-31 12:48, Laeeth Isharc wrote: Often one doesn't know what one wants to write till one starts. I guess the focus will be different coming from Ruby than coming from Basic, because people think in different ways and tend to be solving different sorts of problems - so I should think

Re: Pushing D's mixin to the limits: Project Euler Problem 61 from Ruby to D by David Oftedal

2014-06-13 Thread Jesse Phillips via Digitalmars-d-announce
On Thursday, 12 June 2014 at 20:35:39 UTC, Rounin wrote: Hey there! Yeah, to expect people to register on LiveJournal in this age of Facebook... Sorry about that; It must have been to deter the spammers. I don't leave comments if it is run through facebook, maybe one day. There should be

Re: Pushing D's mixin to the limits: Project Euler Problem 61 from Ruby to D by David Oftedal

2014-06-13 Thread via Digitalmars-d-announce
Another hint: You should return an `int[2]` from `abc()` instead of `int[]`. It's faster and doesn't require a heap allocation.

Pushing D's mixin to the limits: Project Euler Problem 61 from Ruby to D by David Oftedal

2014-06-12 Thread Andrei Alexandrescu via Digitalmars-d-announce
http://rounin.livejournal.com/24639.html http://www.reddit.com/r/programming/comments/27zjd5/pushing_ds_mixin_to_the_limits_project_euler/ https://www.facebook.com/dlang.org/posts/864930913520591 https://twitter.com/D_Programming/status/477162603140374528 Andrei

Re: Pushing D's mixin to the limits: Project Euler Problem 61 from Ruby to D by David Oftedal

2014-06-12 Thread Philippe Sigaud via Digitalmars-d-announce
Drat, I need a livejournal account to post comments? Well, I can at least create a reddit account, I guess... In the Ruby version, I was able to add the methods directly to the Integer class, using what's known as monkey patching, allowing me to make calls like3.pentagonal. In D, the methods are

Re: Pushing D's mixin to the limits: Project Euler Problem 61 from Ruby to D by David Oftedal

2014-06-12 Thread Dicebot via Digitalmars-d-announce
On Thursday, 12 June 2014 at 20:35:39 UTC, Rounin wrote: I still think the double mixin() can compete in terms of comedy value, though, don't you think? That was actually my initial guess when having a quick look trough the code samples :) true D programmers mixin their mixins

Re: Pushing D's mixin to the limits: Project Euler Problem 61 from Ruby to D by David Oftedal

2014-06-12 Thread Rounin via Digitalmars-d-announce
Hey there! Yeah, to expect people to register on LiveJournal in this age of Facebook... Sorry about that; It must have been to deter the spammers. Thanks for taking the time to comment! Your solution with the single call to mixin() is much more elegant. I made a version 2 which uses it.

Re: Pushing D's mixin to the limits: Project Euler Problem 61 from Ruby to D by David Oftedal

2014-06-12 Thread Philippe Sigaud via Digitalmars-d-announce
On Thu, Jun 12, 2014 at 10:35 PM, Rounin via Digitalmars-d-announce digitalmars-d-announce@puremagic.com wrote: Hey there! Oh cool, thanks for answering! Yeah, to expect people to register on LiveJournal in this age of Facebook... Sorry about that; It must have been to deter the spammers.