Andrei Alexandrescu wrote:
Walter and I just discussed the matter of inheriting constructors. Our
thought on the issue:
a) If a class doesn't define any constructors and adds no fields,
inherit constructors. Example:
class MyException : Exception {}
b) If a class defines at least one constr
在 Mon, 30 Nov 2009 09:35:17 +0800,Denis Koroskin <2kor...@gmail.com>
写道:
On Mon, 30 Nov 2009 03:18:27 +0300, Andrei Alexandrescu
wrote:
Denis Koroskin wrote:
On Mon, 30 Nov 2009 02:20:40 +0300, bearophile
wrote:
Andrei Alexandrescu:
c) If a class doesn't define any constructors but
Andrei Alexandrescu wrote:
Walter and I just discussed the matter of inheriting constructors. Our
thought on the issue:
a) If a class doesn't define any constructors and adds no fields,
inherit constructors. Example:
class MyException : Exception {}
b) If a class defines at least one constr
FYI D people.
Snippet:
Other programming gurus, such as Herb Sutter, lead designer of
Microsoft's C++/CLI programming language, predict that writing code to
run on bare metal may come back into fashion, as chip makers find
themselves unable to keep boosting processor speeds at current rates.
On Nov 30, 09 14:02, retard wrote:
Mon, 30 Nov 2009 04:51:19 +, dsimcha wrote:
== Quote from Nick Sabalausky (a...@a.a)'s article
"retard" wrote in message
news:heuh3h$o7...@digitalmars.com...
Hi
after using D1 and Tango for couple of years we decided to experiment
with D2 and Phobos in
On Mon, 30 Nov 2009 07:10:41 +0100, Walter Bright
wrote:
Walter Bright wrote:
And here it is (called opDispatch, Michel Fortin's suggestion):
http://www.dsource.org/projects/dmd/changeset?new=trunk%2f...@268&old=trunk%2f...@267
Fixed reported problems with it:
http://www.dsource.org/pr
The following is a quote from a comment in the Reddit post about asserts
that Walter just linked to:
"Asserts are not without pitfalls, though. If you aren't careful,
what to put in the asserts, the program could behave differently"
A trivial example of this is:
int i;
write(i
KennyTM~ wrote:
By
far the two most important pieces of I/O functionality I need are:
1. Read a text file line-by-line.
foreach (line; new Lines!(char) (new File ("foobar.txt")))
Cout (line).newline;
}
yuck.
Yuck?? I find that code very elegant. How would you like it to be?
Justin Johansson:
> "I think we have maybe five to 10 years left [with Moore's Law]," he
> said. "Optimizations will get very, very sexy again, when people realize
> how we pay for abstractions."
We'll see, but I don't believe that. We'll see. CPUs with 30 cores require a
different kind of opti
Lars T. Kyllingstad:
> Would it be possible (and desirable) for the D compiler to statically
> check that asserts have no side effects?
Only pure asserts?
If you put:
assert (++i == 1);
Inside a function precondition, it gets removed in release mode.
Bye,
bearophile
Ary Borenszweig wrote:
KennyTM~ wrote:
By
far the two most important pieces of I/O functionality I need are:
1. Read a text file line-by-line.
foreach (line; new Lines!(char) (new File ("foobar.txt")))
Cout (line).newline;
}
yuck.
Yuck?? I find that code very elegant. How would you l
On Mon, 30 Nov 2009 13:52:48 +0300, Lars T. Kyllingstad
wrote:
The following is a quote from a comment in the Reddit post about asserts
that Walter just linked to:
"Asserts are not without pitfalls, though. If you aren't careful,
what to put in the asserts, the program could beh
Mon, 30 Nov 2009 12:01:22 +0100, Ary Borenszweig wrote:
> KennyTM~ wrote:
By
far the two most important pieces of I/O functionality I need are:
1. Read a text file line-by-line.
>>>
>>> foreach (line; new Lines!(char) (new File ("foobar.txt")))
>>>Cout (line).newline;
>>>
On Nov 30, 09 19:15, Denis Koroskin wrote:
On Mon, 30 Nov 2009 13:52:48 +0300, Lars T. Kyllingstad
wrote:
The following is a quote from a comment in the Reddit post about
asserts that Walter just linked to:
"Asserts are not without pitfalls, though. If you aren't careful,
what to put in the a
On Nov 30, 09 19:01, Ary Borenszweig wrote:
KennyTM~ wrote:
By
far the two most important pieces of I/O functionality I need are:
1. Read a text file line-by-line.
foreach (line; new Lines!(char) (new File ("foobar.txt")))
Cout (line).newline;
}
yuck.
Yuck?? I find that code very elegant
On Mon, 30 Nov 2009 15:46:45 +0300, KennyTM~ wrote:
On Nov 30, 09 19:15, Denis Koroskin wrote:
On Mon, 30 Nov 2009 13:52:48 +0300, Lars T. Kyllingstad
wrote:
The following is a quote from a comment in the Reddit post about
asserts that Walter just linked to:
"Asserts are not without pitfal
Denis Koroskin wrote:
On Mon, 30 Nov 2009 15:46:45 +0300, KennyTM~ wrote:
On Nov 30, 09 19:15, Denis Koroskin wrote:
On Mon, 30 Nov 2009 13:52:48 +0300, Lars T. Kyllingstad
wrote:
The following is a quote from a comment in the Reddit post about
asserts that Walter just linked to:
"Asserts
Simen kjaeraas:
> test.d(10): Error: template instance opDispatch!("bar") does not match
> template declaration opDispatch(string name,T)
For Walter: this quick coding-testing cycle is an huge improvement over the
original way DMD was developed. Things can be improved still of course, but
this
Mon, 30 Nov 2009 21:06:21 +0800, KennyTM~ wrote:
> On Nov 30, 09 19:01, Ary Borenszweig wrote:
>> KennyTM~ wrote:
> By
> far the two most important pieces of I/O functionality I need are:
>
> 1. Read a text file line-by-line.
foreach (line; new Lines!(char) (new File ("fo
"retard" wrote in message
news:hevn56$2to...@digitalmars.com...
> Mon, 30 Nov 2009 04:51:19 +, dsimcha wrote:
>>
>> Yeah, I dislike Tango's (and Java's) I/O design. I think it's a classic
>> example of overengineering. I don't care how efficient, flexible,
>> complete, etc. it is if it does
"retard" wrote in message
news:hevo45$2to...@digitalmars.com...
> Mon, 30 Nov 2009 04:55:29 +, dsimcha wrote:
>
> Well, they have been teaching the Java i/o stuff to first year students
> for a while now. I completely agree that it's a bit too complicated for
> novices, but it's not the only
"Ary Borenszweig" wrote in message
news:hf03ps$lk...@digitalmars.com...
> Andrei Alexandrescu wrote:
>> Walter and I just discussed the matter of inheriting constructors. Our
>> thought on the issue:
>>
>> a) If a class doesn't define any constructors and adds no fields, inherit
>> constructors
It seems I was not fully mad, Clojure designers have had the same idea, see
page 29 of this document (Click on it, don't save as):
http://clojure.googlegroups.com/web/ClojureExperience.pdf
Be well,
bearophile
"bearophile" wrote in message
news:hf0976$v2...@digitalmars.com...
> Justin Johansson:
>> "I think we have maybe five to 10 years left [with Moore's Law]," he
>> said. "Optimizations will get very, very sexy again, when people realize
>> how we pay for abstractions."
>
> We'll see, but I don't be
Rainer Deyke wrote:
Andrei Alexandrescu wrote:
Denis Koroskin wrote:
Points 2 and 3 introduce undefined behavior, which is not allowed in
SafeD :p
s/undefined/implementation-defined/
Behavior is only implementation-defined if the implementation actually
defines it. When targeting a specific
retard wrote:
Mon, 30 Nov 2009 21:06:21 +0800, KennyTM~ wrote:
On Nov 30, 09 19:01, Ary Borenszweig wrote:
KennyTM~ wrote:
By
far the two most important pieces of I/O functionality I need are:
1. Read a text file line-by-line.
foreach (line; new Lines!(char) (new File ("foobar.txt"))) Cout
retard wrote:
Mon, 30 Nov 2009 12:01:22 +0100, Ary Borenszweig wrote:
KennyTM~ wrote:
By
far the two most important pieces of I/O functionality I need are:
1. Read a text file line-by-line.
foreach (line; new Lines!(char) (new File ("foobar.txt")))
Cout (line).newline;
}
yuck.
Yuck??
Don wrote:
Andrei Alexandrescu wrote:
Walter and I just discussed the matter of inheriting constructors. Our
thought on the issue:
a) If a class doesn't define any constructors and adds no fields,
inherit constructors. Example:
class MyException : Exception {}
b) If a class defines at leas
On Mon, 30 Nov 2009 18:25:41 +0300, Andrei Alexandrescu
wrote:
retard wrote:
Mon, 30 Nov 2009 12:01:22 +0100, Ary Borenszweig wrote:
KennyTM~ wrote:
By
far the two most important pieces of I/O functionality I need are:
1. Read a text file line-by-line.
foreach (line; new Lines!(char) (
Andrei Alexandrescu wrote:
Don wrote:
Andrei Alexandrescu wrote:
Walter and I just discussed the matter of inheriting constructors.
Our thought on the issue:
a) If a class doesn't define any constructors and adds no fields,
inherit constructors. Example:
class MyException : Exception {}
b
== Quote from retard (r...@tard.com.invalid)'s article
> Mon, 30 Nov 2009 21:06:21 +0800, KennyTM~ wrote:
> > On Nov 30, 09 19:01, Ary Borenszweig wrote:
> >> KennyTM~ wrote:
> > By
> > far the two most important pieces of I/O functionality I need are:
> >
> > 1. Read a text file li
On 2009-11-29 18:03:40 -0500, Andrei Alexandrescu
said:
Walter and I just discussed the matter of inheriting constructors. Our
thought on the issue:
a) If a class doesn't define any constructors and adds no fields,
inherit constructors. Example:
class MyException : Exception {}
b) If a c
== Quote from dsimcha (dsim...@yahoo.com)'s article
> == Quote from retard (r...@tard.com.invalid)'s article
> > Mon, 30 Nov 2009 21:06:21 +0800, KennyTM~ wrote:
> > > On Nov 30, 09 19:01, Ary Borenszweig wrote:
> > >> KennyTM~ wrote:
> > > By
> > > far the two most important pieces of I/O
On 2009-11-30 10:30:11 -0500, Andrei Alexandrescu
said:
class MyException : Exception {
private int sysCode;
invariant() { assert(sysCode < 100); }
}
If default initialization of the field puts it in a state that respects
the invariant, there isn't a problem.
I think this simply
Hello l8night,
Too many bugs - no way my superiors allow some program with that bug
list and the open date for version 2. worst is the slow bugfixes.
Check me on this but there may be more know bugs in things like FireFox then
in DMD. The length of the bug list in and of its self say almost
== Quote from BCS (n...@anon.com)'s article
> Hello l8night,
> > Too many bugs - no way my superiors allow some program with that bug
> > list and the open date for version 2. worst is the slow bugfixes.
> >
> Check me on this but there may be more know bugs in things like FireFox then
> in DMD. Th
Simen kjaeraas wrote:
This still does not compile:
struct foo {
void opDispatch( string name, T )( T value ) {
}
}
void main( ) {
foo f;
f.bar( 3.14 );
}
test.d(10): Error: template instance opDispatch!("bar") does not match
template
declaration opDispatch(string name,T)
It
Andrei Alexandrescu Wrote:
> Walter and I just discussed the matter of inheriting constructors. Our
> thought on the issue:
>
> a) If a class doesn't define any constructors and adds no fields,
> inherit constructors. Example:
>
> class MyException : Exception {}
>
> b) If a class defines at
Michel Fortin Wrote:
> On 2009-11-29 18:03:40 -0500, Andrei Alexandrescu
> said:
>
> > Walter and I just discussed the matter of inheriting constructors. Our
> > thought on the issue:
> >
> > a) If a class doesn't define any constructors and adds no fields,
> > inherit constructors. Example:
hi,
thank you all for your answers. i think your are right with look for the
severity of bugs. for my superiors however the thing is different. they just
see a huge amount of bugs, missing gui libraries, missing database libraries
and nothing close to anything that m$ offers in the way of deve
Denis Koroskin wrote:
On Mon, 30 Nov 2009 18:25:41 +0300, Andrei Alexandrescu
wrote:
retard wrote:
Mon, 30 Nov 2009 12:01:22 +0100, Ary Borenszweig wrote:
KennyTM~ wrote:
By
far the two most important pieces of I/O functionality I need are:
1. Read a text file line-by-line.
foreach (li
Denis Koroskin Wrote:
> I think RefCounted should be flexible enough to re-usable for other data
> structures, too (e.g. so that it could be part of Phobos).
>
I agree. However this code goes into core, so it can't use Phobos.
> By the way, your code has a bug:
>
> Tid tid; // or release() a
Walter Bright Wrote:
> Simen kjaeraas wrote:
> > This still does not compile:
> >
> > struct foo {
> > void opDispatch( string name, T )( T value ) {
> > }
> > }
> >
> > void main( ) {
> > foo f;
> > f.bar( 3.14 );
> > }
> >
> > test.d(10): Error: template instance opDispatch!("
retard Wrote:
> Java isn't that bad IMO - you just have to remember the buffer:
>
> BufferedReader input = new BufferedReader(new FileReader("foo"));
> try {
> String line = null;
>
> while (( line = input.readLine()) != null) {
> }
> }
> finally {
> input.close();
> }
One of the importa
Álvaro Castro-Castilla wrote:
It does. Shouldn't this work also?
struct foo {
void opDispatch( string name, T... )( T values ) {
}
}
void main( ) {
http://www.reddit.com/r/programming/comments/a9lxo/assembler_to_c/
== Quote from Roman Ivanov (isro...@km.ru)'s article
> retard Wrote:
> > Java isn't that bad IMO - you just have to remember the buffer:
> >
> > BufferedReader input = new BufferedReader(new FileReader("foo"));
> > try {
> > String line = null;
> >
> > while (( line = input.readLine()) != null)
George Moss Wrote:
> Over in the other camp, someone has set up a custom search engine
> "for everyone complaining that it is impossible to search for Go docs
> and info".
>
> http://go-lang.cat-v.org/go-search
>
> Given similar complains about the likewise "search-unfriendly D word",
> perhaps
On Mon, 30 Nov 2009 23:02:13 +0200, Walter Bright
wrote:
http://www.reddit.com/r/programming/comments/a9lxo/assembler_to_c/
The link posted on reddit in broken: "You are not authorised to view this
resource. You need to login."
Broken link:
http://dobbscodetalk.com/index.php?option=c
Lars T. Kyllingstad, el 30 de noviembre a las 12:16 me escribiste:
> Ary Borenszweig wrote:
> >KennyTM~ wrote:
> By
> far the two most important pieces of I/O functionality I need are:
>
> 1. Read a text file line-by-line.
> >>>
> >>>foreach (line; new Lines!(char) (new File ("foo
On Mon, Nov 30, 2009 at 1:00 PM, Walter Bright
wrote:
> Álvaro Castro-Castilla wrote:
>>
>> It does. Shouldn't this work also?
>>
>> struct foo {
>> void opDispatch( string name, T... )( T values ) { } }
>>
>> void main( ) {
>> f
Walter Bright Wrote:
> dsimcha wrote:
> > Right, but sometimes (though certainly not always) it's better to provide a
> > meta-feature that solves a whole bunch of problems (like better templates)
> > and
> > then solve the individual problems at the library level, rather than add a
> > language
On Mon, 30 Nov 2009 19:07:38 +0100, Walter Bright
wrote:
Simen kjaeraas wrote:
This still does not compile:
struct foo {
void opDispatch( string name, T )( T value ) {
}
}
void main( ) {
foo f;
f.bar( 3.14 );
}
test.d(10): Error: template instance opDispatch!("bar") does n
Bill Baxter wrote:
On Mon, Nov 30, 2009 at 1:00 PM, Walter Bright
void opDispatch(string name, T...)(T values...)
^^^
You didn't use to have to do that with variadic templates. Is that
also a new change in SVN?
I believe it was always like th
Roman Ivanov wrote:
My point is, language is one thing, but "language culture" is
another. For some reason Java bred a culture that encourages bloated,
counter-intuitive, "enterprise" solutions. It's not inherent in the
language. It has more to do with the companies that use it, core API
design a
Ary Borenszweig wrote:
KennyTM~ wrote:
By
far the two most important pieces of I/O functionality I need are:
1. Read a text file line-by-line.
foreach (line; new Lines!(char) (new File ("foobar.txt")))
Cout (line).newline;
}
yuck.
Yuck?? I find that code very elegant. How would you l
Simen kjaeraas wrote:
I'm already in love with this feature.
So am I. It seems to be incredibly powerful.
Looks to me you can do things like:
1. hook up to COM's IDispatch
2. create 'classes' at runtime
3. add methods to existing classes (monkey patching) that allow such
extensions
4. pr
== Quote from Roman Ivanov (x...@y.z)'s article
> Walter Bright Wrote:
> > dsimcha wrote:
> > > Right, but sometimes (though certainly not always) it's better to provide
> > > a
> > > meta-feature that solves a whole bunch of problems (like better
> > > templates) and
> > > then solve the individ
Walter Bright wrote:
Bill Baxter wrote:
On Mon, Nov 30, 2009 at 1:00 PM, Walter Bright
void opDispatch(string name, T...)(T values...)
^^^
You didn't use to have to do that with variadic templates. Is that
also a new change in SVN?
I believe
On Mon, 30 Nov 2009 23:02:46 +0100, Walter Bright
wrote:
Simen kjaeraas wrote:
I'm already in love with this feature.
So am I. It seems to be incredibly powerful.
Looks to me you can do things like:
1. hook up to COM's IDispatch
2. create 'classes' at runtime
3. add methods to existing
On Mon, 30 Nov 2009 23:13:23 +0100, Pelle Månsson
wrote:
Walter Bright wrote:
Bill Baxter wrote:
On Mon, Nov 30, 2009 at 1:00 PM, Walter Bright
void opDispatch(string name, T...)(T values...)
^^^
You didn't use to have to do that with vari
Vladimir Panteleev wrote:
On Mon, 30 Nov 2009 23:02:13 +0200, Walter Bright
wrote:
http://www.reddit.com/r/programming/comments/a9lxo/assembler_to_c/
The link posted on reddit in broken: "You are not authorised to view
this resource. You need to login."
Broken link:
http://dobbscodetal
Simen kjaeraas wrote:
On Mon, 30 Nov 2009 23:13:23 +0100, Pelle Månsson
wrote:
Walter Bright wrote:
Bill Baxter wrote:
On Mon, Nov 30, 2009 at 1:00 PM, Walter Bright
void opDispatch(string name, T...)(T values...)
^^^
You didn't use to hav
Simen kjaeraas wrote:
Oh, and another thing: Will we get property syntax for this?
I'd like to use this for shaders, allowing one to refer to
the shader's own variables directly from D, but currently I am
limited to function call syntax (unless I'm missing something?)
You can do it, but be car
dsimcha wrote:
In Java, by going overboard on making the core language simple,
you end up pushing all the complexity into the APIs.
Yup, and that's the underlying problem with "simple" languages.
Complicated code.
Simen kjaeraas wrote:
It would seem Walter is right, but only for opDispatch. This compiles
fine. If you want compile errors, move the ellipsis around:
Hmm, looks like there is a problem, but it has nothing to do with
opDispatch, as this:
void bar(string s, T...)(T args)
doesn't work ei
On Tue, 01 Dec 2009 00:00:23 +0300, Walter Bright
wrote:
Álvaro Castro-Castilla wrote:
It does. Shouldn't this work also?
struct foo {
void opDispatch( string name, T... )( T values ) { } }
Pelle MÃ¥nsson:
> foreach (line; open("foobar.txt")) {
>writeln(line);
> }
With the xio module of my dlibs:
import d.xio: xfile;
foreach (line; xfile("foobar.txt"))
putr(line);
xfile is optimized to reduce memory rellocations as much as possible in the
most common case of about 90 char
bearophile wrote:
Pelle MÃ¥nsson:
foreach (line; open("foobar.txt")) {
writeln(line);
}
With the xio module of my dlibs:
import d.xio: xfile;
foreach (line; xfile("foobar.txt"))
putr(line);
xfile is optimized to reduce memory rellocations as much as possible in the
most common case
Walter Bright Wrote:
> Simen kjaeraas wrote:
> > I'm already in love with this feature.
>
> So am I. It seems to be incredibly powerful.
>
> Looks to me you can do things like:
>
> 1. hook up to COM's IDispatch
>
> 2. create 'classes' at runtime
>
> 3. add methods to existing classes (monkey
Walter Bright:
> So am I. It seems to be incredibly powerful.
Very powerful things can be dangerous too, they can lead to bugs, etc.
> Looks to me you can do things like:
This is stuff that can be written in the D docs to, for example you can add
some of those examples in the D2 docs page abou
Nick Sabalausky wrote:
"Ary Borenszweig" wrote in message
news:hf03ps$lk...@digitalmars.com...
Andrei Alexandrescu wrote:
Walter and I just discussed the matter of inheriting constructors. Our
thought on the issue:
a) If a class doesn't define any constructors and adds no fields, inherit
co
I'm thinking of adding a final method to Object:
final void useSameLockAs(Object another);
What it does is to make "this" give up on its own lock object and use
the same lock as "another". Probably this may restrict implementations
to some degree (e.g. I'm not sure how that would work with thi
On Mon, Nov 30, 2009 at 3:38 PM, bearophile wrote:
> Walter Bright:
>> So am I. It seems to be incredibly powerful.
>
> Very powerful things can be dangerous too, they can lead to bugs, etc.
I'm a bit concerned about what this does to introspection.
With a dynamic language like Python, adding run
http://www.reddit.com/r/programming/comments/a9mse/walter_bright_from_assembly_to_c/
Hopefully a working link this time.
On Mon, Nov 30, 2009 at 3:20 PM, Alvaro Castro-Castilla
wrote:
> Walter Bright Wrote:
>
>> Simen kjaeraas wrote:
>> > I'm already in love with this feature.
>>
>> So am I. It seems to be incredibly powerful.
>>
>> Looks to me you can do things like:
>>
>> ...
>>
>> 5. the already mentioned "swizzl
Walter Bright Wrote:
> Simen kjaeraas wrote:
> > It would seem Walter is right, but only for opDispatch. This compiles
> > fine. If you want compile errors, move the ellipsis around:
>
> Hmm, looks like there is a problem, but it has nothing to do with
> opDispatch, as this:
>
> void bar(s
On Mon, Nov 30, 2009 at 10:14:32PM +, Spacen Jasset wrote:
> The article doesn't really say why optlink?
That's not really the point though - the article is discussing "how" rather
than "why".
> Why not use another linker?
Speed is a big one, but I imagine familiarity is another - Walter ha
On Mon, Nov 30, 2009 at 02:02:46PM -0800, Walter Bright wrote:
> 3. add methods to existing classes (monkey patching) that allow such
> extensions
I think allowing this in general is a bad idea - the opDispatch should
only be implemented on a small number of classes.
The reason is simple: a typo
A nice article, thank you for writing it for us for free (I used to pay to read
similar texts).
>I had the job at the time of converting a huge (and very successful)
>electronic schematic editor, DASH, from assembler into C. In C it could then
>be recompiled for 32 bits, and even ported to othe
Hi
This is the monthly status for the unofficial d wish list:
http://all-technology.com/eigenpolls/dwishlist/
I am closing this wish list.
New requests should be posted to bugzilla on http://d.puremagic.com/issues/
It would be a great help,
if you could help move some of the wish list items
l8night wrote:
hi,
thank you all for your answers. i think your are right with “look for the
severity of bugs”. for my superiors however the thing is different. they just
see a huge amount of bugs, missing gui libraries, missing database libraries
and nothing close to anything that m$ offers i
Andrei Alexandrescu:
> Why not just reuse the same buffer as the previous line? That approach
> is inherently adaptive.
That approach is unsafe. xfile yields byte strings, in D1. When I write 10
lines long scripts I usually don't need every bit of optimization, I need the
less bug-prone code as
Bill Baxter, el 30 de noviembre a las 16:09 me escribiste:
> On Mon, Nov 30, 2009 at 3:38 PM, bearophile wrote:
> > Walter Bright:
> >> So am I. It seems to be incredibly powerful.
> >
> > Very powerful things can be dangerous too, they can lead to bugs, etc.
>
> I'm a bit concerned about what th
Alvaro Castro-Castilla wrote:
I think this doesn't work as should. This code:
Yes, you're right. I'll look into fixing it.
Bill Baxter wrote:
And once again we see Clugston's Law at work. As soon as you figure
out how to do one thing in D, a new compiler feature comes along that
makes it a one-liner. :-)
The goal is to write a D compiler in one line of code!
Bill Baxter wrote:
Also how does this interact with property syntax?
Define opDispatch with @property.
Adam D. Ruppe wrote:
On Mon, Nov 30, 2009 at 02:02:46PM -0800, Walter Bright wrote:
3. add methods to existing classes (monkey patching) that allow such
extensions
I think allowing this in general is a bad idea - the opDispatch should
only be implemented on a small number of classes.
The reas
Jesse Phillips wrote:
I think if there was more thorough documentation, using ignorant
terminology during explanation, you would see a much better return on
your search results.
The documentation is written with google in mind, hence what I expect to
be the most common search terms for the pag
On Mon, Nov 30, 2009 at 6:03 PM, Walter Bright
wrote:
> Bill Baxter wrote:
>>
>> Also how does this interact with property syntax?
>
> Define opDispatch with @property.
So we can overload on @property-ness? I.e. this works
struct S
{
@property
float x() { return 1.0f; }
float x() { return 2.0f;
Bill Baxter wrote:
So we can overload on @property-ness?
No.
I.e. this works
struct S
{
@property
float x() { return 1.0f; }
float x() { return 2.0f; }
}
void main()
{
S s;
writefln("%s", s.x); // writes 1.0
writefln("%s", s.x()); // writes 2.0
}
That just looks wrong.
Hello,
I'll be in Quebec City on 10-13 December. I understand a couple of you
are from there. If you want to have a beer on Saturday night, please let
me know!
Andrei
Andrei Alexandrescu Wrote:
> I'm thinking of adding a final method to Object:
>
> final void useSameLockAs(Object another);
>
> What it does is to make "this" give up on its own lock object and use
> the same lock as "another". Probably this may restrict implementations
> to some degree (e.g.
Ary Borenszweig Wrote:
> Nick Sabalausky wrote:
> > "Ary Borenszweig" wrote in message
> > news:hf03ps$lk...@digitalmars.com...
> >> Andrei Alexandrescu wrote:
> >>> Walter and I just discussed the matter of inheriting constructors. Our
> >>> thought on the issue:
> >>>
> >>> a) If a class does
On Mon, Nov 30, 2009 at 7:12 PM, Walter Bright
wrote:
> Bill Baxter wrote:
>>
>> So we can overload on @property-ness?
>
> No.
>
>> I.e. this works
>>
>> struct S
>> {
>> @property
>> float x() { return 1.0f; }
>> float x() { return 2.0f; }
>> }
>>
>> void main()
>> {
>> S s;
>> writefln("%
Bill Baxter wrote:
On Mon, Nov 30, 2009 at 7:12 PM, Walter Bright
wrote:
Bill Baxter wrote:
So we can overload on @property-ness?
No.
I.e. this works
struct S
{
@property
float x() { return 1.0f; }
float x() { return 2.0f; }
}
void main()
{
S s;
writefln("%s", s.x); // writes 1.0
Andrei Alexandrescu wrote:
Bill Baxter wrote:
On Mon, Nov 30, 2009 at 7:12 PM, Walter Bright
wrote:
Bill Baxter wrote:
So we can overload on @property-ness?
No.
I.e. this works
struct S
{
@property
float x() { return 1.0f; }
float x() { return 2.0f; }
}
void main()
{
S s;
writefln
97 matches
Mail list logo