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" 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 wanted to.
"Jeremie Pelletier" 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/
>>
>> Disc
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
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:
http://www.digitalmars.com/d/archives/digitalmars/D/scope_as_template_struc
Justin Johansson Wrote:
> Andrei Alexandrescu Wrote:
>
> > Jarrett Billingsley wrote:
> > > On Thu, Oct 1, 2009 at 4:30 PM, Andrei Alexandrescu
> > > wrote:
> > >> Consider:
> > >>
> > >> class A {
> > >>abstract void fun() {}
> > >> }
> > >>
> > >> The class defines a function that is at th
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
> --
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
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:
http://www.digitalmars.com/d/ar
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 similarly.
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
-- Jus
Nick Sabalausky wrote:
"Jeremie Pelletier" 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/
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 mainstr
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 a
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 p
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
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 u
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 m
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 ha
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
> >r
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? D
On Sat, 3 Oct 2009 14:11:37 -0300, Leandro Lucarella
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()
{
void blip() {}
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
cer
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 wrote:
> "Christopher Wright" 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
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 l
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
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 i
On Sat, 03 Oct 2009 21:50:06 +0400, Tomas Lindquist Olsen
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',
or
just 'unsigned',
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 ve
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 woul
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 enough
Andrei Alexandrescu wrote:
Jarrett Billingsley wrote:
On Thu, Oct 1, 2009 at 11:48 PM, Andrei Alexandrescu
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 bodies?
It's not a no-op. Tr
On Sat, 03 Oct 2009 22:47:53 +0400, Walter Bright
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 particular, C++ mangles unsig
Ary Borenszweig wrote:
Andrei Alexandrescu wrote:
Jarrett Billingsley wrote:
On Thu, Oct 1, 2009 at 11:48 PM, Andrei Alexandrescu
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 bodie
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 e
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 e
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 bes
"language_fan" 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 choose from.
>> Some peopl
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 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
extern(C++) u
On 03/10/2009 20:19, Max Samukha wrote:
On Sat, 3 Oct 2009 14:11:37 -0300, Leandro Lucarella
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()
On Sun, 04 Oct 2009 01:48:38 +0400, Michel Fortin
wrote:
On 2009-10-03 17:13:45 -0400, BCS 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?
pr
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 signa
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 reuse
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
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. It
On Thu, 01 Oct 2009 14:23:48 +0300, bearophile
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 to get to the bottom of
Hello Denis,
On Sun, 04 Oct 2009 01:48:38 +0400, Michel Fortin
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 mangled names someone coul
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 G
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 id
On Sat, Oct 3, 2009 at 9:22 PM, Sergey Gromov 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
> happening: defining a
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 clear
bearophile wrote:
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
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 langu
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
Vladimir Panteleev:
> This problem isn't something that can be easily fixed. Any stray reference
> to any node in the list will prevent nodes following it from ever being
> deallocated.
Whoa, a very long and detailed answer :-) Thank you.
Do you know why in LDC this program seems to work in c
62 matches
Mail list logo