null references redux + Looney Tunes

Justin Johansson no at spam.com
Sat Oct 3 13:39:29 PDT 2009


language_fan Wrote:

> On Sat, 03 Oct 2009 14:35:22 -0400, Jeremie Pelletier wrote:
> 
> > language_fan wrote:
> >> On Sat, 03 Oct 2009 10:32:28 -0400, Jeremie Pelletier wrote:
> >> 
> >>> I don't believe D is having some features merely to attract attention
> >>> to it, that's the thing I like best about D; it provides a very large
> >>> set of tools and let me choose how to use them, instead of enforcing a
> >>> certain model or paradigm.
> >> 
> >> There has to be some limit on the amount of features a language can
> >> have before managing the complexity gets too large. Imagine that D 4.0
> >> had 50 keywords more than D 2.0 currently has. Those features would
> >> make your code 5% faster. Would you still love D?
> > 
> > Think of the english languages, how many words does it have? I would
> > hate to try and express my ideas if I had only 100 words to choose from.
> > Some people do but we call them simple minded or uneducated :)
> 
> Comparing spoken languages and formal languages used to program computers 
> is rather far fetched. Even a small child recognizes more words than a 
> complex programming language has keywords. There are programming 
> languages with rather minimal set of core keywords and constructs. This 
> makes them in no way more suitable for less intelligent people. And your 
> stance of disagreeing with everyone here does not make you better than 
> the rest of us, it is just irritating.
> 
> D is pretty verbose in many respects. There are some totally unnecessary 
> words like 'body' in the grammar. Also things like foreach_reverse should 
> just die. Even a novice programmer can write a meta-program to replace 
> foreach_reverse without any runtime performance hit. Designing a crappy 
> programming language is not hard. Usually the elegance arises from clever 
> use of powerful, generic core structures.

Re foreach_reverse

People might remember that when I picked up D and joined this forum just some
3 or so weeks ago I made mention of being a Scala refugee.***  When asked what
I didn't like about Scala I commented about there being too many language constructs.
Someone here (maybe you, Fan?) consequently pointed out some of the superfluous
cruft like foreach_reverse in D.

I couldn't agree more; foreach_reverse should be euthanased by intralexical injection
forthwith.

(***To be fair, my current interest is in non-JVM-hosted languages and I wouldn't be
using a minimalistic language like Clojure (also JVM hosted) either at the moment.)

> Even a novice programmer can write a meta-program to replace foreach_reverse
without any runtime performance hit.

I haven't had much time to investigate/learn meta programming facilities in D so I'm
less than a novice in this respect.  If it's not too much trouble, Fan, please post your
solution for replacing reverse_foreach with a meta-program; I know it sounds lazy of me,
but your answer will save me precious time from having to RTFM.

Guessing its a recursive solution, and btw I am making use of opApply already in a
small collection library that I'm messing with.

Cheers
Justin Johansson




More information about the Digitalmars-d mailing list