www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - [sugar] when all hell breaks loose

reply Manfred Nowak <svv1999 hotmail.com> writes:
From the specs:

| Features To Drop
[...]
| Distinction between . and ->. This distinction is really not
| necessary. The . operator serves just as well for pointer
| dereferencing.


| Class and Struct Properties

| Properties are member functions that can by syntactically
| treated as if they were fields. {parenthesis are not needed}


Without turning a hair most D-guys are using these features.

And Walter was right to drop this frumpy conventions that seems to 
have been intodruced by some sort of reminescense to BASIC, where 
you always have to assure that you are working with a string 
variable by appending a `$' to its name.

But why stop at this point(!)?

When its clear from the definition of the identifier, then there is 
no need to always state `I know, that this is something like a 
function, like an array, like a field, like a pointer ...'

Furthermore the imagination, that an instance of a class acts for 
example like an array is pure virtual since the class can despite 
of the opIndex's have opCall's, opSlice, ...

Therefore we are using only more of this frumpy conventions Walter 
already has dropped for us: lets get rid of () and [] when they are 
not really needed and a point suffices:

`sin.pi' instead of `sin( pi)'
`arr.1'  instead of `arr[ 1]'
`assure.where.isContained.' instead of
  `assure( where( isContained()))'

-manfred :-)
Aug 21 2005
next sibling parent Factory <t t.com> writes:
In article <de9n3m$pao$1 digitaldaemon.com>, svv1999
 hotmail.com says...
 `sin.pi' instead of `sin( pi)'
 `arr.1'  instead of `arr[ 1]'
 `assure.where.isContained.' instead of
   `assure( where( isContained()))'
"Greenspun's Tenth Rule of Programming: any sufficiently complicated C or Fortran program contains an ad hoc informally-specified bug-ridden slow implementation of half of Common Lisp." Well one would only have to change the wording a bit. - Factory, not that I wouldn't mind a bit of lisp in D
Aug 21 2005
prev sibling parent reply "Jarrett Billingsley" <kb3ctd2 yahoo.com> writes:
"Manfred Nowak" <svv1999 hotmail.com> wrote in message 
news:de9n3m$pao$1 digitaldaemon.com...
 `sin.pi' instead of `sin( pi)'
 `arr.1'  instead of `arr[ 1]'
 `assure.where.isContained.' instead of
  `assure( where( isContained()))'

 -manfred :-)
aaaaaaAAAAAAAAAAHHHHHHHHHHHHHHH!!!!!!
Aug 21 2005
parent reply Manfred Nowak <svv1999 hotmail.com> writes:
"Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote:

[...]
 aaaaaaAAAAAAAAAAHHHHHHHHHHHHHHH!!!!!! 
I understand your squealing with glee for the things to come. Lets have a look at the sources that will be coming with dmd after that change: std.file: line 476: if .!callback.std.utf.toUTF8.fileinfo.cFileName.0..clength line 851: if .std.c.linux.linux.chdir.toStringz.pathname std.boxer: line 663: assert .unboxable!.char. .box."foobar"; std.socket: line 626: return ntohl.inet_addr.std.string.toStringz.addr; std.windows: line 2521: LPSTR MAKEINTRESOURCEA.int i{ return cast.LPSTR cast.DWORD cast.WORD i; } Brave new world. -manfred :-)
Aug 22 2005
next sibling parent David Medlock <noone nowhere.com> writes:
Manfred Nowak wrote:
 "Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote:
 
 [...]
 
aaaaaaAAAAAAAAAAHHHHHHHHHHHHHHH!!!!!! 
I understand your squealing with glee for the things to come. Lets have a look at the sources that will be coming with dmd after that change: std.file: line 476: if .!callback.std.utf.toUTF8.fileinfo.cFileName.0..clength line 851: if .std.c.linux.linux.chdir.toStringz.pathname std.boxer: line 663: assert .unboxable!.char. .box."foobar"; std.socket: line 626: return ntohl.inet_addr.std.string.toStringz.addr; std.windows: line 2521: LPSTR MAKEINTRESOURCEA.int i{ return cast.LPSTR cast.DWORD cast.WORD i; } Brave new world. -manfred :-)
That is starting to look like Forth, with dots instead of spaces... -DavidM
Aug 22 2005
prev sibling parent Hasan Aljudy <hasan.aljudy gmail.com> writes:
Manfred Nowak wrote:
 "Jarrett Billingsley" <kb3ctd2 yahoo.com> wrote:
 
 [...]
 
aaaaaaAAAAAAAAAAHHHHHHHHHHHHHHH!!!!!! 
I understand your squealing with glee for the things to come. Lets have a look at the sources that will be coming with dmd after that change: std.file: line 476: if .!callback.std.utf.toUTF8.fileinfo.cFileName.0..clength line 851: if .std.c.linux.linux.chdir.toStringz.pathname std.boxer: line 663: assert .unboxable!.char. .box."foobar"; std.socket: line 626: return ntohl.inet_addr.std.string.toStringz.addr; std.windows: line 2521: LPSTR MAKEINTRESOURCEA.int i{ return cast.LPSTR cast.DWORD cast.WORD i; } Brave new world. -manfred :-)
I think this reduces readability to the ground.
Aug 22 2005