Jump to page: 1 216  
Page
Thread overview
DMD 0.148 release
Feb 26, 2006
Walter Bright
Feb 26, 2006
Derek Parnell
Feb 26, 2006
Tom
Feb 26, 2006
Derek Parnell
Feb 26, 2006
Tom
Feb 26, 2006
Wang Zhen
Feb 26, 2006
Kyle Furlong
Feb 26, 2006
Derek Parnell
Feb 26, 2006
bobef
Feb 26, 2006
Derek Parnell
Feb 26, 2006
bobef
Feb 26, 2006
Georg Wrede
Feb 26, 2006
Kyle Furlong
Feb 26, 2006
Tom
Feb 26, 2006
Wang Zhen
Feb 26, 2006
Derek Parnell
Feb 26, 2006
Kyle Furlong
Feb 26, 2006
Ivan Senji
Feb 26, 2006
Tom
Feb 26, 2006
Tom
Feb 26, 2006
Georg Wrede
Feb 26, 2006
Kyle Furlong
Feb 26, 2006
Derek Parnell
Feb 26, 2006
Georg Wrede
Feb 26, 2006
Ivan Senji
Feb 26, 2006
Georg Wrede
Feb 26, 2006
Ivan Senji
Feb 27, 2006
Georg Wrede
Feb 27, 2006
Tom
Feb 27, 2006
Georg Wrede
Feb 27, 2006
Ivan Senji
Different types of boolean (Was: Re: DMD 0.148 release)
Feb 27, 2006
Oskar Linde
Feb 27, 2006
Ivan Senji
Feb 27, 2006
Tom
Feb 27, 2006
Walter Bright
Feb 27, 2006
Ivan Senji
Feb 27, 2006
Roberto Mariottini
Feb 27, 2006
Walter Bright
Feb 27, 2006
Derek Parnell
Feb 28, 2006
Walter Bright
Feb 28, 2006
Bruno Medeiros
Feb 28, 2006
Tom
Mar 01, 2006
James Dunne
Feb 28, 2006
Sean Kelly
Feb 28, 2006
Deewiant
Feb 28, 2006
Derek Parnell
Feb 28, 2006
Sean Kelly
I assume this can't be done yet
Mar 01, 2006
Georg Wrede
Mar 01, 2006
Don Clugston
Jan 18, 2007
Luís Marques
Mar 01, 2006
James Dunne
Mar 01, 2006
Deewiant
Feb 27, 2006
Ivan Senji
Feb 28, 2006
Tom
Feb 28, 2006
Ivan Senji
Feb 28, 2006
Lucas Goss
Feb 28, 2006
Oskar Linde
Feb 28, 2006
Kyle Furlong
Feb 28, 2006
Oskar Linde
Feb 28, 2006
Ivan Senji
Feb 28, 2006
Ivan Senji
Feb 28, 2006
Don Clugston
Feb 28, 2006
Walter Bright
Feb 28, 2006
Oskar Linde
Feb 28, 2006
Tom
Feb 28, 2006
Derek Parnell
Feb 28, 2006
Ivan Senji
Feb 28, 2006
Carlos Santander
Mar 01, 2006
Roberto Mariottini
Mar 01, 2006
Tom
Bools reloaded
Mar 02, 2006
Bruno Medeiros
Mar 02, 2006
Don Clugston
Mar 03, 2006
Bruno Medeiros
Mar 02, 2006
Tom
Mar 03, 2006
Don Clugston
Mar 03, 2006
Kyle Furlong
Mar 03, 2006
Bruno Medeiros
Mar 03, 2006
Tom
Mar 03, 2006
Don Clugston
Mar 03, 2006
xs0
Mar 03, 2006
Ivan Senji
Mar 03, 2006
xs0
Mar 03, 2006
Ivan Senji
Mar 04, 2006
Bruno Medeiros
Mar 04, 2006
Ivan Senji
Mar 06, 2006
xs0
Mar 06, 2006
Ivan Senji
Mar 03, 2006
Oskar Linde
Mar 03, 2006
xs0
Mar 03, 2006
Tom
Mar 03, 2006
Ivan Senji
Mar 03, 2006
Oskar Linde
Mar 03, 2006
Ivan Senji
Mar 03, 2006
Oskar Linde
Mar 03, 2006
Ivan Senji
Mar 04, 2006
Oskar Linde
Mar 04, 2006
Ivan Senji
Mar 05, 2006
Miles
Mar 05, 2006
Oskar Linde
Mar 05, 2006
Miles
Feb 28, 2006
Walter Bright
Feb 28, 2006
Lionello Lunesu
Feb 28, 2006
Bruno Medeiros
Feb 27, 2006
Ivan Senji
Feb 27, 2006
Deewiant
Feb 27, 2006
Ivan Senji
Feb 27, 2006
Deewiant
Feb 28, 2006
Charles Hixson
Feb 28, 2006
Ivan Senji
Feb 27, 2006
Derek Parnell
Feb 26, 2006
Derek Parnell
Feb 27, 2006
Georg Wrede
Feb 26, 2006
Ivan Senji
Feb 26, 2006
Georg Wrede
Feb 27, 2006
Ivan Senji
Feb 27, 2006
Georg Wrede
Feb 27, 2006
Ivan Senji
Feb 27, 2006
BCS
[Flame On]Re: DMD 0.148 release
Feb 27, 2006
Kyle Furlong
Feb 27, 2006
Georg Wrede
Feb 27, 2006
Tom
Feb 27, 2006
Ivan Senji
Feb 26, 2006
Derek Parnell
Feb 26, 2006
James Dunne
Feb 26, 2006
Georg Wrede
Feb 26, 2006
Wang Zhen
Feb 26, 2006
Kyle Furlong
Feb 26, 2006
Derek Parnell
Feb 26, 2006
Ivan Senji
Feb 26, 2006
Charles
Feb 26, 2006
Thomas Kuehne
Feb 26, 2006
Regan Heath
Feb 26, 2006
Derek Parnell
Feb 26, 2006
Regan Heath
Feb 26, 2006
Ivan Senji
Feb 27, 2006
Regan Heath
Feb 26, 2006
Thomas Kuehne
Feb 26, 2006
Regan Heath
Feb 27, 2006
Walter Bright
Feb 28, 2006
Thomas Kuehne
Mar 01, 2006
Walter Bright
Feb 26, 2006
Derek Parnell
Feb 26, 2006
Georg Wrede
Feb 26, 2006
Derek Parnell
Feb 26, 2006
John Reimer
Feb 26, 2006
Thomas Kuehne
Feb 26, 2006
Dave
Feb 26, 2006
Thomas Kuehne
Feb 26, 2006
Ivan Senji
Mar 07, 2006
Russ Lewis
February 26, 2006
Lots of new stuff, I added new threads for them in the digitalmars.D newsgroup.

http://www.digitalmars.com/d/changelog.html




February 26, 2006
On Sun, 26 Feb 2006 12:54:15 +1100, Walter Bright <newshound@digitalmars.com> wrote:

> Lots of new stuff, I added new threads for them in the digitalmars.D
> newsgroup.
>

Well you almost got bool right <G> Everything except that it does implicit conversion to int. That is just a cheap cop out for lazy coding, IMNSHO.

//--------------------
import std.stdio;

void main()
{
  bool a;
  bool b;
  bool c;
  bool d;
  int e;

  a = true;
  b = true;
  c = true;
  d = a + b + c;
  e = a + b + c; // In a decent implentation, this should have failed to compile
  writefln("%s %s %s %s %s", a,b,c,d,e);
  writefln("%d %d %d %d %d", a,b,c,d,e); // And this might have been a runtime error?

}
//-------------------
-- 
Derek Parnell
Melbourne, Australia
February 26, 2006
In article <op.s5kaquba6b8z09@ginger.vic.bigpond.net.au>, Derek Parnell says...
>
>On Sun, 26 Feb 2006 12:54:15 +1100, Walter Bright

[snip]

>   d = a + b + c;

Sorry, how is the above different than the next?

>   e = a + b + c; // In a decent implentation, this should have failed to
> compile

I mean, in a decent implementation, would it be right to allow '+' (numeric add operator) between boolean vars?

Regards,

Tom;
February 26, 2006
Walter Bright wrote:
> Lots of new stuff, I added new threads for them in the digitalmars.D newsgroup.
> 
> http://www.digitalmars.com/d/changelog.html
> 
> 

:P

New releases with bug fixes are always welcome, and I'm excited at the possibility of improvements with new features... Yet I'm just a little concerned about the recent additions of these new features.  It looks like you've already begun ramping up for your experimental fork planned for post 1.0.  It's definitely good to see you practicing for that! :D But I'm worried that this is being done /before/ release 1.0.  Isn't bug fixing supposed to be the highest priority now?

Okay... I'll keep quite, now.

-JJR
February 26, 2006
Derek Parnell wrote:
> On Sun, 26 Feb 2006 12:54:15 +1100, Walter Bright  <newshound@digitalmars.com> wrote:
> 
>> Lots of new stuff, I added new threads for them in the digitalmars.D
>> newsgroup.
>>
> 
> Well you almost got bool right <G> Everything except that it does implicit  conversion to int. That is just a cheap cop out for lazy coding, IMNSHO.

Pardon my ignorance, but why does D need a primitive type for booleans in the first place? What's wrong with "alias ubyte bool;" or "alias int bool;"? Can't we simply treat zero as false and non-zero as true as we C programmers always do?


> 
> //--------------------
> import std.stdio;
> 
> void main()
> {
>   bool a;
>   bool b;
>   bool c;
>   bool d;
>   int e;
> 
>   a = true;
>   b = true;
>   c = true;
>   d = a + b + c;
>   e = a + b + c; // In a decent implentation, this should have failed to  compile
>   writefln("%s %s %s %s %s", a,b,c,d,e);
>   writefln("%d %d %d %d %d", a,b,c,d,e); // And this might have been a  runtime error?
> 
> }
> //-------------------

February 26, 2006
Wang Zhen wrote:
> Derek Parnell wrote:
>> On Sun, 26 Feb 2006 12:54:15 +1100, Walter Bright  <newshound@digitalmars.com> wrote:
>>
>>> Lots of new stuff, I added new threads for them in the digitalmars.D
>>> newsgroup.
>>>
>>
>> Well you almost got bool right <G> Everything except that it does implicit  conversion to int. That is just a cheap cop out for lazy coding, IMNSHO.
> 
> Pardon my ignorance, but why does D need a primitive type for booleans in the first place? What's wrong with "alias ubyte bool;" or "alias int bool;"? Can't we simply treat zero as false and non-zero as true as we C programmers always do?
> 
> 
>>
>> //--------------------
>> import std.stdio;
>>
>> void main()
>> {
>>   bool a;
>>   bool b;
>>   bool c;
>>   bool d;
>>   int e;
>>
>>   a = true;
>>   b = true;
>>   c = true;
>>   d = a + b + c;
>>   e = a + b + c; // In a decent implentation, this should have failed to  compile
>>   writefln("%s %s %s %s %s", a,b,c,d,e);
>>   writefln("%d %d %d %d %d", a,b,c,d,e); // And this might have been a  runtime error?
>>
>> }
>> //-------------------
> 

Because there exists a boolean type that has different contstraints than a normal integral type. In a good type system, these are enforced by the compiler with a builtin type. Search for Derek's post about it in the D NG.
February 26, 2006
On Sun, 26 Feb 2006 15:33:18 +1100, Tom <Tom_member@pathlink.com> wrote:

> In article <op.s5kaquba6b8z09@ginger.vic.bigpond.net.au>, Derek Parnell says...
>>
>> On Sun, 26 Feb 2006 12:54:15 +1100, Walter Bright
>
> [snip]
>
>>   d = a + b + c;
>
> Sorry, how is the above different than the next?
>
>>   e = a + b + c; // In a decent implentation, this should have failed to
>> compile
>
> I mean, in a decent implementation, would it be right to allow '+' (numeric add
> operator) between boolean vars?
>

No it wouldn't either. I rushed my response as I was going out visiting my Dad - he turned 74 today.

-- 
Derek Parnell
Melbourne, Australia
February 26, 2006
On Sun, 26 Feb 2006 17:29:03 +1100, Wang Zhen <nehzgnaw@gmail.com> wrote:

> Derek Parnell wrote:
>> On Sun, 26 Feb 2006 12:54:15 +1100, Walter Bright  <newshound@digitalmars.com> wrote:
>>
>>> Lots of new stuff, I added new threads for them in the digitalmars.D
>>> newsgroup.
>>>
>>  Well you almost got bool right <G> Everything except that it does implicit  conversion to int. That is just a cheap cop out for lazy coding, IMNSHO.
>
> Pardon my ignorance,

That's okay.

> but why does D need a primitive type for booleans in the first place? What's wrong with "alias ubyte bool;" or "alias int bool;"?

The short answer is that booleans are not numbers. They represent truth and falsehood.

> Can't we simply treat zero as false and non-zero as true as we C programmers always do?

*We* are not C programmers ;-) *We* have grown up from that baby-talk ;-)

Zero is frequently used to implement the concept of falsehood and likewise non-zero for truth, however the semantics of integers is not the same as the semantics of booleans. But because many C programers are just *so* used to thinking this way they have become to believe that zero *is* falsehood rather than just a number chosen to implement the concept.

It is quite possible for a language to implement falsehood/truth is ways other than using integers but even if they do, the compiler can still ensure that the sematics are adhered to rather than continue using integer sematics.

The only thing I can see wrong with D's new boolean is that it still pretends its a number. Why is this wrong? Because it can lead to coding mistakes and abuse. Thus making maintenance more costly than it needed to be.

Walter is still living in the C/C++ past with this concept, which is strange seeing he has implemented so many progressive concepts in D. Boolean as an integer is just retro.

-- 
Derek Parnell
Melbourne, Australia
February 26, 2006
Derek Parnell wrote:
> 
> Zero is frequently used to implement the concept of falsehood and likewise non-zero for truth, however the semantics of integers is not the same as the semantics of booleans. But because many C programers are just *so* used to thinking this way they have become to believe that zero *is* falsehood rather than just a number chosen to implement the concept.
> 

Just thoughts...

Well back in school we were learning boolean algebra. (for some electrical crap... I don't remember... I don't care...). Even if we take just the name 'boolean algebra' it means it used for calculations, which means it is number not falsehood... After all it used for all these logical operators which operate with numbers not falsehood... If we say it is not calculations and it is logical operations, well it is not, else it would be only true, false, if a to b is false and c to b is true then a to c is ... this kind of stuff. But it is actually used for numbers and calculations, because 01101010<<0202 is not logic anymore it is mathematics which is also logic but other kind than true/false, logic for the quantity of things not their rightness...
And one more thing. If it is falsehood indeed, then it is something abstract. Technically speaking True and False have any meaning only in the context of each other, i.e. in the context of some logic, system or whatever, not in the context of numbers. So how are you going to convert from number to falsehood? This would limit us to writing only bool a=true || bool a=false, which seems annoying to me. bool a=1 is shorter ;]. Plus there will be no if(a), if(b), because a is always true or always false by itself, it should relate to something else to be right or wrong, so we will always have to write if(a==1), if(b==null) instead, so I like it this way ;]

Am I talking nonsese? :)
February 26, 2006
Walter Bright schrieb am 2006-02-26:
> Lots of new stuff, I added new threads for them in the digitalmars.D newsgroup.
>
> http://www.digitalmars.com/d/changelog.html
>

Missing from the changelog:

added DMD Script Shell http://www.digitalmars.com/d/rdmd.html

Thomas


« First   ‹ Prev
1 2 3 4 5 6 7 8 9 10 11