x.sizeof vs typeid(x)

Tom S h3r3tic at remove.mat.uni.torun.pl
Thu Feb 7 06:32:03 PST 2008


Sergey Gromov wrote:
> Are you sure this is to the better ?  I'm not quite fond of D's freedom
> in syntax.  It already allows to write an unreadable code like this:
> 
> use(context) in (GL gl) {draw(gl);}

And when I actually asked for comments about that syntax, no one stated 
that it was unreadable ... thanks for the (mislocated) feedback.

As for the exact form of that use() in .. statement, I made it so with 
the sole purpose of it being *readable*. It may be new to you; it 
usually makes people think that the construct is built into D, resulting 
in some confusion ("did I miss anything in the spec?"). Yet ultimately 
using the language's features to write code which looks built-in makes 
code easier to read. If my statement is false, then using AST macros in 
lisp makes the code less readable as well.


-- 
Tomasz Stachowiak
http://h3.team0xf.com/
h3/h3r3tic on #D freenode



More information about the Digitalmars-d mailing list