@property - take it behind the woodshed and shoot it?
Rob T
alanb at ucora.com
Thu Jan 24 16:17:01 PST 2013
On Thursday, 24 January 2013 at 22:04:02 UTC, Andrei Alexandrescu
wrote:
[..]
>
> There's been a lot of strong positions years ago about
> functions vs. procedures, statements vs. expressions, or even
> (the glorious 60s!) in-language I/O primitives vs. I/O as
> library facilities. Successful languages managed to obviate
> such dichotomies.
>
>
> Andrei
Yeah, back in the day it was a relief to no longer have to decide
if I needed to write a function or if I needed to write a
procedure. With D, it's been a relief to no longer have to use
empty () everywhere.
I think we've become stuck in a way of thinking that is creating
a lot more complexity than is actually required.
For example, I can change my perception of what a variable is and
instead view it to be specialized form of function. It has a
default implementation and implied storage, which is returned by
ref. The compiler can optimize away the need to a real function
call.
If you take on a view like that, then it may be possible to
simplify the language by merging specialized types with alternate
syntax into one generalized type with identical syntax. You'll
also be forced to implement things in a more consistent and
unambiguous way as you proceed along. For example, there has to
be different methods for getting the address of the data vs the
address of the implementation, and the same solution can work for
all types provided that they are treated in the same way.
--rt
More information about the Digitalmars-d
mailing list