Delight

bearophile bearophileHUGS at lycos.com
Sun Oct 12 06:56:56 PDT 2008


Thomas Leonard:

>"int" would still be available as an alias (probably to int64).

That may cause troubles because in D int is 32 bit.
So it may be an alias to the signed size_t, or of the 32 bit int...


>Doesn't that work at the moment?<

I don't see the Ruby-like syntax in your site.


>There's a simple web server here, for a slightly longer example:<

I did see that. But I think few more mixed little examples are can be really useful. Look at the code of the Shootout, because it's useful as "rosetta code" too, not just for its original benchmarking purposes.

Look in your filtered emails again :-)

--------------------

More things from the site:

>- anonymous functions work ("function(int x): x + 1"). This is like
lambda in Python.<

Note that D1 and D2 already support this syntax:
(int x, float y) { return x+y; }


For Delight a little shorter syntax may be adopted, for example:
(int x, float y): x+y
Or:
lambda int x, float y: x+y
Or:
fun int x, float y: x+y
Or:
int x, float y => x+y


>- any object can be implicitly cast to Object (D doesn't allow this)<

Is this good? (just asking)


>Statements end at the end of a line. Semi-colons are not required.<

Is the \ syntax possible for too much long lines, as in Python?


>(the author is arguing for spaces, but the main point is consistency).<

Nope, the main point was to not use tabs to indent code in Python. You can't miss a "detail" as important as this in such post.


>Anonymous functions cannot access variables in their containing function, but you can use a delegate for that:<

When not specified you can use a delegate by default (as D does inside functions).


>These are D/Java style try/catch/finally syntax:<

The semantics of D exceptions is quite different from the Java one.

Bye,
bearophile


More information about the Digitalmars-d-announce mailing list