Thread overview | ||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
January 30, 2010 dmd 1.056 and 2.040 release | ||||
---|---|---|---|---|
| ||||
http://www.digitalmars.com/d/1.0/changelog.html http://ftp.digitalmars.com/dmd.1.056.zip http://www.digitalmars.com/d/2.0/changelog.html http://ftp.digitalmars.com/dmd.2.040.zip Thanks to the many people who contributed to this update! |
January 30, 2010 Function implementation in interface | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | First, i would like to say: thank you. Second, i would like to have your opinion: "added static/final function implementations to interfaces" Could you allow normal function imp to interfaces too? Interface will look like c++ struct, but the difference is the way inheritance organized, so that diamond shape problem does not exist. And you could simplify something too. For example: for comparison between classes, we just inherit Comparable interface, which has implementation of many op<, op>, op<=, op>=, ... (Well, in fact, this is done in Scala, it is named linearization). :) For example: class Biology { ...... } interface Animal { void eat() { ... } void run() { ... } } interface Bird { void fly() { ... } } class Penguin : Biology, Animal, Bird { } The left most class / interface will be the top super. Each interface remain will solve its parent at definition site (line "class Penguin : Biology, Animal, Bird") Result: Penguin -> Bird -> Animal -> Biology. Details of linearization are in page 52, ScalaRef. http://www.scala-lang.org/sites/default/files/linuxsoft_archives/docu/files/ScalaReference.pdf Thanks. |
January 30, 2010 Re: dmd 1.056 and 2.040 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On Jan 30, 10 15:13, Walter Bright wrote:
>
> http://www.digitalmars.com/d/1.0/changelog.html
> http://ftp.digitalmars.com/dmd.1.056.zip
>
>
> http://www.digitalmars.com/d/2.0/changelog.html
> http://ftp.digitalmars.com/dmd.2.040.zip
>
> Thanks to the many people who contributed to this update!
Is the changelog page broken? On the 2.0 changelog it starts with "$(D_S D Change Log,", and without a navigation bar.
|
January 30, 2010 Re: dmd 1.056 and 2.040 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | This release makes me smile. Thank you so much Walter, and everybody who contributed too. |
January 30, 2010 Re: dmd 1.056 and 2.040 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to KennyTM~ | On 30.01.2010 09:32, KennyTM~ wrote:
> On Jan 30, 10 15:13, Walter Bright wrote:
>>
>> http://www.digitalmars.com/d/1.0/changelog.html
>> http://ftp.digitalmars.com/dmd.1.056.zip
>>
>>
>> http://www.digitalmars.com/d/2.0/changelog.html
>> http://ftp.digitalmars.com/dmd.2.040.zip
>>
>> Thanks to the many people who contributed to this update!
>
> Is the changelog page broken? On the 2.0 changelog it starts with "$(D_S
> D Change Log,", and without a navigation bar.
And 1.056 is missing, only its changelog is present, but under the 1.055 header.
|
January 30, 2010 Re: dmd 1.056 and 2.040 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Regarding this: Bugzilla 3556: version(CTFE) I have written the following little D2 program: import std.stdio: printf; static if (__ctfe) { int foo() { return 1; } } else { int foo() { return 2; } } enum int x1 = foo(); void main() { int x2 = foo(); printf("%d %d\n", x1, x2); } But it doesn't work, I don't understand why. (Isn't the usage of __ctfe normally done at compile time? Otherwise this feature introduces another very special case in the language). ---------------- Can you tell me the purpose of the following 3 changes? ModuleInfo changed from class to struct added static/final function implementations to interfaces http://dsource.org/projects/dmd/changeset/339 Thank you, bye, bearophile |
January 30, 2010 Re: dmd 1.056 and 2.040 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | On 1/30/10 08:13, Walter Bright wrote:
>
> http://www.digitalmars.com/d/1.0/changelog.html
> http://ftp.digitalmars.com/dmd.1.056.zip
>
>
> http://www.digitalmars.com/d/2.0/changelog.html
> http://ftp.digitalmars.com/dmd.2.040.zip
>
> Thanks to the many people who contributed to this update!
Very nice.
What happened to the change log for 1.055?
Why can't we get version(CTFE) in D1 also?
|
January 30, 2010 Re: dmd 1.056 and 2.040 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Jacob Carlborg | Jacob Carlborg wrote:
> On 1/30/10 08:13, Walter Bright wrote:
>>
>> http://www.digitalmars.com/d/1.0/changelog.html
>> http://ftp.digitalmars.com/dmd.1.056.zip
>>
>>
>> http://www.digitalmars.com/d/2.0/changelog.html
>> http://ftp.digitalmars.com/dmd.2.040.zip
>>
>> Thanks to the many people who contributed to this update!
>
> Very nice.
> What happened to the change log for 1.055?
> Why can't we get version(CTFE) in D1 also?
You can ask this question for all other D2 features backwards compatible to D1 too. Why isn't __traits in D1? Why can't D1 have thread local variables (I'm not talking about TLS-by-default here)?
|
January 30, 2010 Re: dmd 1.056 and 2.040 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to bearophile | == Quote from bearophile (bearophileHUGS@lycos.com)'s article > Regarding this: > Bugzilla 3556: version(CTFE) > I have written the following little D2 program: > import std.stdio: printf; > static if (__ctfe) { > int foo() { > return 1; > } > } else { > int foo() { > return 2; > } > } > enum int x1 = foo(); > void main() { > int x2 = foo(); > printf("%d %d\n", x1, x2); > } > But it doesn't work, I don't understand why. > (Isn't the usage of __ctfe normally done at compile time? Otherwise this feature introduces another very special case in the language). > ---------------- > Can you tell me the purpose of the following 3 changes? > ModuleInfo changed from class to struct > added static/final function implementations to interfaces > http://dsource.org/projects/dmd/changeset/339 > Thank you, > bye, > bearophile Because a compile-time __ctfe turned out to be almost impossible to implement. Therefore, __ctfe is nominally a regular (runtime) variable that evaluatest to true at compile time and false at runtime. The proper use is if(__ctfe), not static if(__ctfe). However, if(0) statements are thrown out by the code gen, so there should be no runtime performance hit for using if(__ctfe). |
January 30, 2010 Re: dmd 1.056 and 2.040 release | ||||
---|---|---|---|---|
| ||||
Posted in reply to Walter Bright | Walter Bright wrote:
>
> http://www.digitalmars.com/d/1.0/changelog.html
> http://ftp.digitalmars.com/dmd.1.056.zip
>
>
> http://www.digitalmars.com/d/2.0/changelog.html
> http://ftp.digitalmars.com/dmd.2.040.zip
>
> Thanks to the many people who contributed to this update!
Very nice! Each release kills a lot of bugs and adds small but very powerful features.
About the interface functions, this compiles:
--
import std.stdio;
interface One {
final void foo() {
writefln("One");
}
}
interface Two {
final void foo() {
writefln("Two");
}
}
class X : One, Two {
}
class Y : Two, One {
}
void main() {
X x = new X();
x.foo(); // prints "One"
Y y = new Y();
y.foo(); // prints "Two"
}
--
Is this intended behaviour? Might leads to obscure bugs...
|
Copyright © 1999-2021 by the D Language Foundation