May 27, 2005
> You know what I can't stand?  That pesky "if" keyword.  Why can't we just use the ?: operator everywhere?  The fewer keywords, the easier, right? :P

yeah! - now you're gettin' in the spirit!


May 27, 2005
"Sean Kelly" <sean@f4.ca> wrote in message news:d75jdf$930$1@digitaldaemon.com...
> If that isn't enough, Bjarne Stroustrup and Herb Sutter proposed a
language
> extension for the next iteration of the C++ standard: the addition of a 'nullptr' constant (http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2003/n1488.pdf).  In
short,
> I think there's ample support for the existence of 'null' in D :)

Some day, C++ will catch up with D <g>.


May 27, 2005
Ben Hinkle wrote:
>>You know what I can't stand?  That pesky "if" keyword.  Why can't we just use the ?: operator everywhere?  The fewer keywords, the easier, right? :P
> 
> 
> yeah! - now you're gettin' in the spirit! 
> 
> 

and we can replace for, foreach, and while loops with goto :P
May 27, 2005
You know what bothers me?  All those darned extra button on this keyboard thingy ... why can't we program using only the space-bar and ctrl-key?


"Ben Hinkle" <ben.hinkle@gmail.com> wrote in message news:d75ug9$i2a$1@digitaldaemon.com...
> > You know what I can't stand?  That pesky "if" keyword.  Why can't we
just
> > use the ?: operator everywhere?  The fewer keywords, the easier, right? :P
>
> yeah! - now you're gettin' in the spirit!
>
>


May 27, 2005
On Thu, 26 May 2005 21:52:07 -0400, Ben Hinkle wrote:

>> You know what I can't stand?  That pesky "if" keyword.  Why can't we just use the ?: operator everywhere?  The fewer keywords, the easier, right? :P
> 
> yeah! - now you're gettin' in the spirit!

I once used a notation that went a bit like this ...

  (? name = "derek"
     <T> (amt := 10)
     <F> (amt := 1)
  )

Weird at first, but I got used to it quickly.

-- 
Derek
Melbourne, Australia
27/05/2005 12:14:06 PM
May 27, 2005
Derek Parnell wrote:
> I once used a notation that went a bit like this ...
> 
>   (? name = "derek"
>      <T> (amt := 10)
>      <F> (amt := 1)
>   )
> 
> Weird at first, but I got used to it quickly.

Looks semi-Lisp-ish... or maybe Guile/Scheme... what on earth was/is it?  Although I did once use something similar:

# ? (name == "derek")
#   : amt = 10
#   ; amt = 1
# .

And yes that period (.) does go at the end... and if either of the clauses, seperated by a semi-colon (;) had multiple statements... they were seperated by a comma (,)... cute, huh?  I think demons invented it.

-- Chris Sauls
May 27, 2005
On Thu, 26 May 2005 21:33:14 -0500, Chris Sauls wrote:

> Derek Parnell wrote:
>> I once used a notation that went a bit like this ...
>> 
>>   (? name = "derek"
>>      <T> (amt := 10)
>>      <F> (amt := 1)
>>   )
>> 
>> Weird at first, but I got used to it quickly.
> 
> Looks semi-Lisp-ish... or maybe Guile/Scheme... what on earth was/is it?

[embarrased]
It was a simple scripting language that I developed when working with IBM
360 mainframes back in the 1970s. I was playing around with Lisp, PL/I,
Fortran, and Autocoder then. Seemed like a good idea at the time ;-)

It could do really bad stuff ...

   (? amt
      < lt 10 > ( f := '+= 10') ; add 10 when < 10
      < le 20 > ( f := '+= 1') ; add 1 when between 10 and 20
      < > ( f := '+= 5') ; otherwise add 5
   )
   (amt $f) ; apply formula

-- 
Derek
Melbourne, Australia
27/05/2005 12:31:39 PM
May 27, 2005
Derek Parnell wrote:
>    (? amt       < lt 10 > ( f := '+= 10') ; add 10 when < 10
>       < le 20 > ( f := '+= 1') ; add 1 when between 10 and 20
>       < > ( f := '+= 5') ; otherwise add 5
>    )
>    (amt $f) ; apply formula 
> 

Ahh.. so 'f' contained an "arbitrary" expression to be evaluated in terms of a variable via a '(xxx $f)' expression... creative.  As a friend of mine once said of one of his student's code... "Cute.  Not wise... but cute."  :)  *steals the idea*

-- Chris Sauls
May 27, 2005
Jarrett Billingsley wrote:
> "Sam" <Sam_member@pathlink.com> wrote in message news:d75g34$6eb$1@digitaldaemon.com...
> 
> This is .. quite simply the most inane argument I've seen anyone make on any forum or NG in a long time.  The last time I saw something this crazy, someone was arguing over the proper name for a style of 3d shading, and he was arguing the wrong name.
> 
> You want to remove something as simple, innocuous, and commonly-used as the "null" keyword?
> 
> What would you do if "null" weren't a keyword?  I'm sure there's a lot of opportunity opened up for variable and function names by removing that pesky restriction.
> 
> You said something about "the fewer keywords a language has, the easier it is to learn."  That is .. the second most inane argument I've ever heard. The number of keywords has nothing to do with the programming style, runtime library, under-the-hood functionality, structure, or overall complexity of the language.  "true," "false," and "null" are simply there to increase readability, and because it conceptually makes no sense to compare a class reference to 0.  New programmers shouldn't have to understand the underlying concepts of memory addresses in a language like D, and shouldn't have to know that address 0 means "nothing."  If anything, having "null" makes it easier to learn the language.
> 
> You know what I can't stand?  That pesky "if" keyword.  Why can't we just use the ?: operator everywhere?  The fewer keywords, the easier, right?  :P 
> 
> 

hmm ..
# right?  :P
is that a ternary operator usage? :P // <<-- same here
May 27, 2005
Sam wrote:
> Should I use NULL or 0?
> 
> To quote Bjarne Stroustrup, the god of C++:
> 
> "In C++, the definition of NULL is 0, so there is only an aesthetic difference.
> I prefer to avoid macros, so I use 0. Another problem with NULL is that people
> sometimes mistakenly believe that it is different from 0 and/or not an integer.
> In pre-standard code, NULL was/is sometimes defined to something unsuitable and
> therefore had/has to be avoided. That's less common these days."
> 
> ---->  http://www.research.att.com/~bs/bs_faq2.html#null
> 
> So as you can see, even the great Bjarne Stroustrup believes we don't need a
> 'null' keyword.
> 
> He also believes that garbage collection was never needed in C++, as
> std::auto_ptr<T> can handle everything.
> I don't fully agree with this...  But I can't really say he's wrong here either.
> 
> I guess my question is: What has D taken from this "so called" wisdom from a "so
> called" guru?
> 
> 

As Sean Kelly pointed out, your Bjarne Stroustrup thinks it's a good idea to introduce a "null" keyword in C++. except that he's naming it "nullptr", and he's only doing that to avoid name conflicts .. because many people are using "null" already.

hmm .. the mistake of no implementing "null" in the first place, caused him to choose a less clean name, "nullptr" ..