Tom S wrote:
I think it should be done in userland, not built-in. Here's a
proof-of-concept implementation:
I agree and also had a go at it a few months back:
http://www.digitalmars.com/d/archives/digitalmars/D/scope_as_template_struct_82104.html
What about alignment issues though? I think we
Christopher Wright dhase...@gmail.com wrote in message
news:ha5mtp$f3...@digitalmars.com...
BCS wrote:
This is true of any long document if you are willing to string together
enough quotes and ignore enough of it. I'd bet you could get the
Declaration of Intendance out of Playboy if you
Jeremie Pelletier jerem...@gmail.com wrote in message
news:ha51v1$24p...@digitalmars.com...
Justin Johansson wrote:
For the interest of newsgroups readers, I dropped in at the Cafe the
other day and
the barista had this to say
http://cafe.elharo.com/programming/imagine-theres-no-null/
http://www.reddit.com/r/programming/comments/9qf8i/i_wrote_some_d_today_and_its_completely_blowing/
Walter Bright:
http://www.reddit.com/r/programming/comments/9qf8i/i_wrote_some_d_today_and_its_completely_blowing/
Very nice. Indeed if you come from experience of C, D allows you to write
programs in a much faster way. (But C isn't the only language around today, you
also have dotnet C#, for
On Sat, 03 Oct 2009 10:52:09 +0400, Christian Kamm
kamm-incasoftw...@removethis.de wrote:
Tom S wrote:
I think it should be done in userland, not built-in. Here's a
proof-of-concept implementation:
I agree and also had a go at it a few months back:
Justin Johansson Wrote:
Andrei Alexandrescu Wrote:
Jarrett Billingsley wrote:
On Thu, Oct 1, 2009 at 4:30 PM, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
Consider:
class A {
abstract void fun() {}
}
The class defines a function that is at the same
Walter Bright Wrote:
http://www.reddit.com/r/programming/comments/9qf8i/i_wrote_some_d_today_and_its_completely_blowing/
Don't know why you bother with Reddit, Walter. Going by a lot of the replies
there, its a case of
pearls before swine.
Cheers
-- Justin Johansson
Justin Johansson wrote:
Walter Bright Wrote:
http://www.reddit.com/r/programming/comments/9qf8i/i_wrote_some_d_today_and_its_completely_blowing/
Don't know why you bother with Reddit, Walter. Going by a lot of the replies
there, its a case of
pearls before swine.
Cheers
-- Justin
Nick Sabalausky wrote:
static void Main(string[] args)
{
Foo f;
if(args.Count() 2) { f = new Foo(); }
if(args.Count() 2)
{
f.bar(); // ERROR: Use of unassgned local variable 'f'
}
Foo f2;
createFoo(ref f2); // ERROR: Use of unassgned local variable 'f2'
On 03/10/2009 11:59, Denis Koroskin wrote:
On Sat, 03 Oct 2009 10:52:09 +0400, Christian Kamm
kamm-incasoftw...@removethis.de wrote:
Tom S wrote:
I think it should be done in userland, not built-in. Here's a
proof-of-concept implementation:
I agree and also had a go at it a few months back:
I'm currently writing a program that interfaces with C++.
C++ code uses a lot of 'unsigned long', which equals to 'unsigned int', or
just 'unsigned', but is mangled differently.
In particular, C++ mangles unsigned long as 'K', and I can't find a D
counterpart that would be mangled
language_fan wrote:
Fri, 02 Oct 2009 10:16:05 -0400, Jeremie Pelletier thusly wrote:
I expect my $3k computer to not slow down to a crawl
because its software is written in a safe way and I like people with
older computers to still be able to run my programs without waiting 5
minutes between
Yigal Chripun wrote:
On 02/10/2009 16:16, Jeremie Pelletier wrote:
Justin Johansson wrote:
For the interest of newsgroups readers, I dropped in at the Cafe the
other day and
the barista had this to say
http://cafe.elharo.com/programming/imagine-theres-no-null/
Disclaimer: YMMV
Cheers
--
Nick Sabalausky wrote:
Jeremie Pelletier jerem...@gmail.com wrote in message
news:ha51v1$24p...@digitalmars.com...
Justin Johansson wrote:
For the interest of newsgroups readers, I dropped in at the Cafe the
other day and
the barista had this to say
language_fan wrote:
Fri, 02 Oct 2009 12:38:33 -0500, Andrei Alexandrescu thusly wrote:
I'll note two things. For one, Walter is a heck more progressive than
his pedigree might lead one to think. He has taken quite some risks with
a number of features that made definite steps outside the
Andrei Alexandrescu wrote:
Justin Johansson wrote:
For the interest of newsgroups readers, I dropped in at the Cafe the
other day and
the barista had this to say
http://cafe.elharo.com/programming/imagine-theres-no-null/
Disclaimer: YMMV
Cheers
-- Justin Johansson
This article brings up
Jeremie Pelletier wrote:
Andrei Alexandrescu wrote:
Justin Johansson wrote:
For the interest of newsgroups readers, I dropped in at the Cafe the
other day and
the barista had this to say
http://cafe.elharo.com/programming/imagine-theres-no-null/
Disclaimer: YMMV
Cheers
-- Justin Johansson
On Sat, 03 Oct 2009 10:32:28 -0400, Jeremie Pelletier wrote:
I don't believe D is having some features merely to attract attention to
it, that's the thing I like best about D; it provides a very large set
of tools and let me choose how to use them, instead of enforcing a
certain model or
Andrei Alexandrescu, el 2 de octubre a las 19:10 me escribiste:
Leandro Lucarella wrote:
We might have very different taste, but I find that a little... horrible.
What do you have against mixins? I think you're trying to use D as C++ :)
If mixins work better, all the better. How would you
On 03/10/2009 16:09, Jeremie Pelletier wrote:
I don't think you understood what I meant, seat-belts don't require you
to buy a bigger car engine because they don't affect the performance of
the car whatsoever. They're also not enforced, the car will run just as
fine if you don't wear them.
I
Leandro Lucarella wrote:
Andrei Alexandrescu, el 2 de octubre a las 19:10 me escribiste:
Leandro Lucarella wrote:
We might have very different taste, but I find that a little... horrible.
What do you have against mixins? I think you're trying to use D as C++ :)
If mixins work better, all the
Andrei Alexandrescu, el 3 de octubre a las 11:23 me escribiste:
Leandro Lucarella wrote:
Andrei Alexandrescu, el 2 de octubre a las 19:10 me escribiste:
Leandro Lucarella wrote:
We might have very different taste, but I find that a little... horrible.
What do you have against mixins? I
Leandro Lucarella wrote:
Andrei Alexandrescu, el 3 de octubre a las 11:23 me escribiste:
Leandro Lucarella wrote:
Andrei Alexandrescu, el 2 de octubre a las 19:10 me escribiste:
Leandro Lucarella wrote:
We might have very different taste, but I find that a little... horrible.
What do you
Andrei Alexandrescu, el 3 de octubre a las 12:03 me escribiste:
So, there we are, you have D, which doesn't support MI per se, you have to
hack it. You can do it with the nested-inherited-classes+alias-this hack,
or by using interfaces+mixins. We agree at least that you have the same
result
On Sat, 03 Oct 2009 13:52:51 -0300, Leandro Lucarella wrote:
Scala supports that with mixins, D supports that with multiple
subtyping.
I don't know what you mean about multiple subtyping.
I have also not seen the specs for this feature. How does multiple
subtyping work exactly in D? Does
On Sat, 3 Oct 2009 14:11:37 -0300, Leandro Lucarella
llu...@gmail.com wrote:
Ok, then, I just find it ugly and unnecessary since you can do the same
with interfaces+mixins.
Actually, you can't. Consider:
interface IBlipper
{
void blip();
void nameCollision();
}
template Blipper()
{
language_fan wrote:
On Sat, 03 Oct 2009 10:32:28 -0400, Jeremie Pelletier wrote:
I don't believe D is having some features merely to attract attention to
it, that's the thing I like best about D; it provides a very large set
of tools and let me choose how to use them, instead of enforcing a
Denis Koroskin wrote:
I'm currently writing a program that interfaces with C++.
C++ code uses a lot of 'unsigned long', which equals to 'unsigned int',
or just 'unsigned', but is mangled differently.
In particular, C++ mangles unsigned long as 'K', and I can't find a D
counterpart that would
On Sat, Oct 3, 2009 at 4:00 AM, Nick Sabalausky a...@a.a wrote:
Christopher Wright dhase...@gmail.com wrote in message
news:ha5mtp$f3...@digitalmars.com...
BCS wrote:
This is true of any long document if you are willing to string together
enough quotes and ignore enough of it. I'd bet you
On Sat, Oct 3, 2009 at 2:55 PM, Denis Koroskin 2kor...@gmail.com wrote:
I'm currently writing a program that interfaces with C++.
C++ code uses a lot of 'unsigned long', which equals to 'unsigned int', or
just 'unsigned', but is mangled differently.
In particular, C++ mangles unsigned long as
On Sat, 03 Oct 2009 14:35:22 -0400, Jeremie Pelletier wrote:
language_fan wrote:
On Sat, 03 Oct 2009 10:32:28 -0400, Jeremie Pelletier wrote:
I don't believe D is having some features merely to attract attention
to it, that's the thing I like best about D; it provides a very large
set of
On Sat, 03 Oct 2009 04:35:39 -0400, bearophile wrote:
Walter Bright:
http://www.reddit.com/r/programming/comments/9qf8i/
i_wrote_some_d_today_and_its_completely_blowing/
Very nice. Indeed if you come from experience of C, D allows you to
write programs in a much faster way. (But C isn't
On Sat, 03 Oct 2009 21:50:06 +0400, Tomas Lindquist Olsen
tomas.l.ol...@gmail.com wrote:
On Sat, Oct 3, 2009 at 2:55 PM, Denis Koroskin 2kor...@gmail.com wrote:
I'm currently writing a program that interfaces with C++.
C++ code uses a lot of 'unsigned long', which equals to 'unsigned int',
Hello language_fan,
You have probably already noticed that there is always a tradeoff to
be made. Either you get smaller binaries and faster compilation times
or larger binaries and (perhaps) more efficient runtime performance.
Note that if the data structures are small, generating them takes
Hello Andrei,
I think this has been discussed in this group already.
[...]
That
means the constructor needs special scrutiny, in particular a cannot
be null because that wouldn't make much sense.
I think the same device used for the base class constructor could be used.
What syntax it
Hello Christopher,
BCS wrote:
Hello Walter,
Consider the Bible. It's long and complicated, and by careful
examination of it you can find a verse here and there to justify
*any* behavior.
This is true of any long document if you are willing to string
together enough quotes and ignore
Andrei Alexandrescu wrote:
Jarrett Billingsley wrote:
On Thu, Oct 1, 2009 at 11:48 PM, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
But.. you mark something abstract when you want it to be .. abstract.
How would you argue that abstract is basically a no-op when used on
methods with
On Sat, 03 Oct 2009 22:47:53 +0400, Walter Bright
newshou...@digitalmars.com wrote:
Denis Koroskin wrote:
I'm currently writing a program that interfaces with C++.
C++ code uses a lot of 'unsigned long', which equals to 'unsigned int',
or just 'unsigned', but is mangled differently.
In
Ary Borenszweig wrote:
Andrei Alexandrescu wrote:
Jarrett Billingsley wrote:
On Thu, Oct 1, 2009 at 11:48 PM, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
But.. you mark something abstract when you want it to be .. abstract.
How would you argue that abstract is basically a no-op
language_fan wrote:
On Sat, 03 Oct 2009 13:52:51 -0300, Leandro Lucarella wrote:
Scala supports that with mixins, D supports that with multiple
subtyping.
I don't know what you mean about multiple subtyping.
I have also not seen the specs for this feature. How does multiple
subtyping work
language_fan wrote:
On Sat, 03 Oct 2009 13:52:51 -0300, Leandro Lucarella wrote:
Scala supports that with mixins, D supports that with multiple
subtyping.
I don't know what you mean about multiple subtyping.
I have also not seen the specs for this feature. How does multiple
subtyping work
language_fan Wrote:
On Sat, 03 Oct 2009 14:35:22 -0400, Jeremie Pelletier wrote:
language_fan wrote:
On Sat, 03 Oct 2009 10:32:28 -0400, Jeremie Pelletier wrote:
I don't believe D is having some features merely to attract attention
to it, that's the thing I like best about D; it
language_fan somewh...@internet.com.invalid wrote in message
news:ha87kd$2j3...@digitalmars.com...
On Sat, 03 Oct 2009 14:35:22 -0400, Jeremie Pelletier wrote:
Think of the english languages, how many words does it have? I would
hate to try and express my ideas if I had only 100 words to
Hello Denis,
That's not always possible. Imagine LGPL'd code, or code which is
distributed in precompiled form only (header + library).
would, explicitly stating the mangled name work?
pragam(mangle, mangled name) // proposed feature
extern(C++) uint SomeFunction();
On 2009-10-03 17:13:45 -0400, BCS n...@anon.com said:
Hello Denis,
That's not always possible. Imagine LGPL'd code, or code which is
distributed in precompiled form only (header + library).
would, explicitly stating the mangled name work?
pragam(mangle, mangled name) // proposed feature
On 03/10/2009 20:19, Max Samukha wrote:
On Sat, 3 Oct 2009 14:11:37 -0300, Leandro Lucarella
llu...@gmail.com wrote:
Ok, then, I just find it ugly and unnecessary since you can do the same
with interfaces+mixins.
Actually, you can't. Consider:
interface IBlipper
{
void blip();
On Sun, 04 Oct 2009 01:48:38 +0400, Michel Fortin
michel.for...@michelf.com wrote:
On 2009-10-03 17:13:45 -0400, BCS n...@anon.com said:
Hello Denis,
That's not always possible. Imagine LGPL'd code, or code which is
distributed in precompiled form only (header + library).
would,
Max Samukha wrote:
The above sucks because we can't specify which nameCollision gets
implemented by which mixin. In current D, nameCollision of both
interfaces is implemented by Flipper.
I don't think that being able to define multiple separate functions with
the same name and the same
There is a simple and elegant solution to the problem of false positives
in static analysis. Simple provide a way for the programmer to say, I
know this looks dangerous, but I know what I'm doing, so trust me on
this. This could be done by adding some new syntax, either a new
keyword or a reused
language_fan Wrote:
On Sat, 03 Oct 2009 04:35:39 -0400, bearophile wrote:
Walter Bright:
http://www.reddit.com/r/programming/comments/9qf8i/
i_wrote_some_d_today_and_its_completely_blowing/
Very nice. Indeed if you come from experience of C, D allows you to
write programs in a
language_fan wrote:
It is funny to note that every time these new fans of D come from the C /
C++ / Java community. It is well known that those languages have long
been in a stagnant stage and if the developers just had courage to try
modern languages, *any* language would have a fresh feel.
On Thu, 01 Oct 2009 14:23:48 +0300, bearophile bearophileh...@lycos.com
wrote:
Time ago Jon Harrop has found a memory leak in a F# program running on
Mono, he has reduced the program to a minimal test case. I have
translated that code to D2 and Python2:
Sorry for the late reply. I wanted
Hello Denis,
On Sun, 04 Oct 2009 01:48:38 +0400, Michel Fortin
michel.for...@michelf.com wrote:
Why not just:
extern(C++, mangled name) uint SomeFunction();
where mangled name could be any constant expression?
Whatever the syntax, this is a great idea. With constant expressions
for
I have found this page linked from Reddit (click Toggle all summaries at the
top to read the full page):
http://google-styleguide.googlecode.com/svn/trunk/cppguide.xml
At Google C++ isn't the most used language, so it may be better to use a C++
style guide from a firm that uses C++ more than
Fri, 25 Sep 2009 15:35:11 -0400, Adam D. Ruppe wrote:
macro max(int a, int b) {
return a ~~ b ~ ? ~ a ~ : ~ b;
}
void main() {
auto num1 = 10;
auto num2 = 20;
auto result = max(num1, num2);
}
While I like and support the idea, I think that
On Sat, Oct 3, 2009 at 9:22 PM, Sergey Gromov snake.sc...@gmail.com wrote:
While I like and support the idea, I think that hijacking the macro
keyword now will make it very hard to re-design later. It would be much
better to reuse the mixin keyword for this since it's exactly what's
bearophile Wrote:
Regular Functions: Functions should start with a capital letter and have a
capital letter for each new word. No underscores:
That's ugly.
Coming from a career in acronym-city (aerospace), project management mandated
that use of acronyms
in identifiers MUST be clearly
Jeremie Pelletier:
I think these are more programming guidelines than language design rules.
Yes, of course. But programming guidelines can give possible ideas to a
language designer, because:
- if everyone is encouraged to follow a certain idiom to avoid bugs, it may be
good to let the
bearophile wrote:
Jeremie Pelletier:
I think these are more programming guidelines than language design rules.
Yes, of course. But programming guidelines can give possible ideas to a
language designer, because:
- if everyone is encouraged to follow a certain idiom to avoid bugs, it may be
Justin Johansson wrote:
How does one determine the sizeof (in bytes) of an instance of a class in D?
.sizeof works as advertised for structs, but for reference types,
.sizeof yields the sizeof the referencing variable (effectively same as size of
a pointer)
and not the size of the underlying
On Sat, Oct 3, 2009 at 5:50 PM, Justin Johansson n...@spam.com wrote:
How does one determine the sizeof (in bytes) of an instance of a class in D?
.sizeof works as advertised for structs, but for reference types,
.sizeof yields the sizeof the referencing variable (effectively same as size
of
Jarrett Billingsley Wrote:
On Sat, Oct 3, 2009 at 5:50 PM, Justin Johansson n...@spam.com wrote:
How does one determine the sizeof (in bytes) of an instance of a class in D?
.sizeof works as advertised for structs, but for reference types,
.sizeof yields the sizeof the referencing
Justin Johansson wrote:
Jarrett Billingsley Wrote:
On Sat, Oct 3, 2009 at 5:50 PM, Justin Johansson n...@spam.com wrote:
How does one determine the sizeof (in bytes) of an instance of a class in D?
.sizeof works as advertised for structs, but for reference types,
.sizeof yields the sizeof
Jeremie Pelletier Wrote:
Justin Johansson wrote:
Jarrett Billingsley Wrote:
On Sat, Oct 3, 2009 at 5:50 PM, Justin Johansson n...@spam.com wrote:
How does one determine the sizeof (in bytes) of an instance of a class in
D?
.sizeof works as advertised for structs, but for
There was mention** on the general discussion group that the D foreach_reverse
language construct could be replaced (emulated?) with a (D) meta-program.
** Even a novice programmer can write a meta-program to replace
foreach_reverse without any runtime performance hit.
Justin Johansson wrote:
There was mention** on the general discussion group that the D foreach_reverse
language construct could be replaced (emulated?) with a (D) meta-program.
** Even a novice programmer can write a meta-program to replace
foreach_reverse without any runtime performance
Jarrett Billingsley wrote:
On Sat, Oct 3, 2009 at 5:50 PM, Justin Johansson n...@spam.com wrote:
How does one determine the sizeof (in bytes) of an instance of a class in D?
.sizeof works as advertised for structs, but for reference types,
.sizeof yields the sizeof the referencing variable
Daniel Keep wrote:
...
Note: this is VERY old code, but I have no reason to think it won't
still work. I may need a little dusting off...
*It* may need a little dusting off. Argh.
http://d.puremagic.com/issues/show_bug.cgi?id=52
Walter Bright bugzi...@digitalmars.com changed:
What|Removed |Added
CC|
http://d.puremagic.com/issues/show_bug.cgi?id=102
--- Comment #11 from Rainer Schuetze r.sagita...@gmx.de 2009-10-03 06:27:15
PDT ---
(In reply to comment #8)
IMHO this is a VERY promising patch since it potentially fixes many difficult
issues. It's not quite complete though.
I've run it
http://d.puremagic.com/issues/show_bug.cgi?id=3301
Rainer Schuetze r.sagita...@gmx.de changed:
What|Removed |Added
Attachment #454 is|0 |1
72 matches
Mail list logo