Rainer Deyke:
> Either I'm missing something, or this system only checks units at
> runtime (which would make it both slow and unsafe).
>
> Boost.Units (C++) checks units at compile time. There is no reason why
> D could not use the same approach.
In F#, compile time checks shown by the IDE too
"Justin Johansson" wrote in message
news:had7hc$1dc...@digitalmars.com...
> Nick Sabalausky Wrote:
>>
>> This is gonna sound trivial (and probably is), but it's been bugging the
>> hell out of me:
>>
>> What is the meaning of the "+ Looney Tunes" added to the title of this
>> sub-thread? I don't
downs:
> I'm not buying that. What kind of function would that be? I can't imagine a
> need for this.
I don't know, sorry.
But I'd like to have such method to define my collections as false when they
are empty, this is really handy. And it may be useful to make nullable values
false.
Bye,
bea
bearophile wrote:
> Denis Koroskin:
>
>> I don't see any reason why if (someComplexNumber) { ... } should be a
> valid code, it hardly makes any sense for me.<
>
> In general I think adding a boolean-evaluation standard method to D can be
> positive and handy and not that bug-prone.
> But comp
Rainer Deyke wrote:
Boost.Units (C++) checks units at compile time. There is no reason why
D could not use the same approach.
Oskar's code I posted does it at compile time.
bearophile wrote:
Scala has a powerful type system that allows to implement such things in a good
enough way:
http://www.michaelnygard.com/blog/2009/05/units_of_measure_in_scala.html
So does D:
===
// by Oskar Linde Aug 2006
// This is just a quick
Nick Sabalausky Wrote:
> "Justin Johansson" wrote in message
> news:ha4qpi$189...@digitalmars.com...
> > 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:
> The only problem with these was that there was no way to signal the
> location of the type error in the client code, it always reported the
> location of the (static) assert in the library, which is pretty much
> useless.
That's a compiler problem, no? I don't think this
Nick Sabalausky wrote:
> I've been thinking it might be nice to have both. Compile-time for obvious
> reasons but then also run-time ones that could do conversions:
>
> auto velocity = convert(meter/second)(distance / time); // Actual
> runtime-conversion
I'm pretty sure Boost.Units already doe
"language_fan" wrote in message
news:hacm6o$2e...@digitalmars.com...
> Mon, 05 Oct 2009 11:41:52 +, language_fan wrote:
>>
>> There have been several existing implementations of SI unit libraries
>> for D. By Oskar Linde et al. The checking can be built statically
>> without any runtime perfo
"language_fan" wrote in message
news:hacnq3$2e...@digitalmars.com...
> Mon, 05 Oct 2009 08:03:11 -0400, Nick Sabalausky thusly wrote:
>
>> "Rainer Deyke" wrote in message
>
>> I've been thinking it might be nice to have both. Compile-time for
>> obvious reasons but then also run-time ones that c
Mon, 05 Oct 2009 08:03:11 -0400, Nick Sabalausky thusly wrote:
> "Rainer Deyke" wrote in message
> I've been thinking it might be nice to have both. Compile-time for
> obvious reasons but then also run-time ones that could do conversions:
> Although that would probably be far from trivial to de
"Rainer Deyke" wrote in message
news:haclah$33...@digitalmars.com...
> bearophile wrote:
>> Scala has a powerful type system that allows to implement such things
>> in a good enough way:
>>
>> http://www.michaelnygard.com/blog/2009/05/units_of_measure_in_scala.html
>
> Either I'm missing somethin
Mon, 05 Oct 2009 05:29:20 -0600, Rainer Deyke thusly wrote:
> bearophile wrote:
>> Scala has a powerful type system that allows to implement such things
>> in a good enough way:
>>
>> http://www.michaelnygard.com/blog/2009/05/
units_of_measure_in_scala.html
>
> Either I'm missing something, or t
Mon, 05 Oct 2009 11:41:52 +, language_fan wrote:
> Mon, 05 Oct 2009 05:29:20 -0600, Rainer Deyke thusly wrote:
>
>> bearophile wrote:
>>> Scala has a powerful type system that allows to implement such things
>>> in a good enough way:
>>>
>>> http://www.michaelnygard.com/blog/2009/05/
> units
bearophile wrote:
> Scala has a powerful type system that allows to implement such things
> in a good enough way:
>
> http://www.michaelnygard.com/blog/2009/05/units_of_measure_in_scala.html
Either I'm missing something, or this system only checks units at
runtime (which would make it both slow a
> ranged y = 1000; // Uh, bypasses the setter, no errors
> writeln(y); // 0?
In the last version of DMD it gives an error:
ranged y = 1000;
temp.d(23): Error: cannot implicitly convert expression (1000) of type int to
ranged
Better. And opCast may help here. No implicit cast.
Bye,
bea
Nick Sabalausky:
> -- fig A ---
> open(inFile ~ "out" ~ inFile.file ~ "log");
> // As many as 4 different errors that could be caught but currently aren't.
> // (But obviously all would be overridable, of course)
> // Without such checking, if inFile contained "/usr/home/joe/foo/bar.dat",
Denis Koroskin:
>I don't see any reason why if (someComplexNumber) { ... } should be a
valid code, it hardly makes any sense for me.<
In general I think adding a boolean-evaluation standard method to D can be
positive and handy and not that bug-prone.
But complex numbers are FP, so you usually
"Justin Johansson" wrote in message
news:ha4qpi$189...@digitalmars.com...
> 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
>
This is
Andrei Alexandrescu:
> We got to stop somewhere.
The precise stopping point can be discussed.
In the new C++ they have even added some flexibility in such regard:
http://stackoverflow.com/questions/237804/user-defined-literals-in-c0x-a-much-needed-addition-or-making-c-even-more-bl
Bye,
bearophil
Ary Borenszweig:
> What are those two methods named in C#? I didn't know about them.
They are just named operator true and operator false. What I don't understand
is why there are two of them, one of them looks enough to me:
http://msdn.microsoft.com/en-us/library/6x6y6z4d%28loband%29.aspx
http
Andrei Alexandrescu Wrote:
> Justin Johansson wrote:
> > Andrei Alexandrescu Wrote:
> >
> >> Nick Sabalausky wrote:
> >>> "Justin Johansson" wrote in message
> >>> news:haavf1$2gs...@digitalmars.com...
> It's a difficult challenge to get high performance, readable and
> maintainable
bearophile wrote:
(Python has such standard method, as I have described (its name is diffeernt),
while C# has two methods for true and falseness of an object/struct).
Hi bearophile,
What are those two methods named in C#? I didn't know about them.
Nick Sabalausky wrote:
"Andrei Alexandrescu" wrote in message
news:hac2ku$1nf...@digitalmars.com...
Justin Johansson wrote:
"Now please name five remarkable complex literals."
(re, im) ::= (0, 0), (1,0), (0,1), (1,1), (pi/2, 0), (0, pi/2),
e_to_the_power_(minus j),
e_to_the_power_(minus j *
Nick Sabalausky wrote:
"Andrei Alexandrescu" wrote in message
news:hab3r2$2pg...@digitalmars.com...
Nick Sabalausky wrote:
There's been discussion before (I can't find it now, or remember the name
for it) of type systems that allow for proper handling of things like m/s
vs. m/(s*s) vs inch/mi
"Andrei Alexandrescu" wrote in message
news:hac2ku$1nf...@digitalmars.com...
> Justin Johansson wrote:
>>
>>> "Now please name five remarkable complex literals."
>>
>> (re, im) ::= (0, 0), (1,0), (0,1), (1,1), (pi/2, 0), (0, pi/2),
>> e_to_the_power_(minus j),
>> e_to_the_power_(minus j * pi/2)
"Andrei Alexandrescu" wrote in message
news:hab3r2$2pg...@digitalmars.com...
> Nick Sabalausky wrote:
>>
>> There's been discussion before (I can't find it now, or remember the name
>> for it) of type systems that allow for proper handling of things like m/s
>> vs. m/(s*s) vs inch/min etc. I ha
Justin Johansson wrote:
Andrei Alexandrescu Wrote:
Nick Sabalausky wrote:
"Justin Johansson" wrote in message
news:haavf1$2gs...@digitalmars.com...
It's a difficult challenge to get high performance, readable and
maintainable code out of complex number
intensive algorithms. Use of library
To test my level of ignorance of D2, and to test how structs can be used to
implement complex numbers in the std lib I have done few experiments with
something simile, subsets of integers.
I have found some problems, some of them may come from my ignorance. This is a
natural number:
import std
On Mon, 05 Oct 2009 01:47:00 +0400, language_fan
wrote:
Something that came to my mind while reading this: typedefs could also be
extended to support contracts just like functions.
It is a nice idea! It would make D typedef much more powerful and useful.
On Mon, 05 Oct 2009 01:03:01 +0400, bearophile
wrote:
Walter Bright:
The
big reason for moving it to a library type is the user defined type
capabilities of D have grown to the point where there is no longer much
of any advantage to having it built in.
If the compiler/language is now flex
Andrei Alexandrescu Wrote:
> Nick Sabalausky wrote:
> > "Justin Johansson" wrote in message
> > news:haavf1$2gs...@digitalmars.com...
> >> It's a difficult challenge to get high performance, readable and
> >> maintainable code out of complex number
> >> intensive algorithms. Use of library ty
On Sun, Oct 4, 2009 at 5:58 PM, Andrei Alexandrescu
wrote:
> bearophile wrote:
>>
>> opIf sounds strange :-) Why don't you like the idea of the implicit
>> conversion to bool followed by the testing of the bool? (someone may
>> have already answered a similar question, please bear with me).
>
> Tr
bearophile Wrote:
> Justin Johansson Wrote:
>
> > Bingo. I'm sure there would be a huge benefit to be able to distinguish
> > string or any primitive type
> > in such manner without having to invent a Filename class, AbsolutePathName
> > class etc.
>
> Can D typedef be used for such purpose?
>
bearophile wrote:
opIf sounds strange :-) Why don't you like the idea of the implicit
conversion to bool followed by the testing of the bool? (someone may
have already answered a similar question, please bear with me).
Try this:
void * p;
if (p) {}
Then try this:
void * p;
bool b = p;
Andr
Justin Johansson Wrote:
> Bingo. I'm sure there would be a huge benefit to be able to distinguish
> string or any primitive type
> in such manner without having to invent a Filename class, AbsolutePathName
> class etc.
Can D typedef be used for such purpose?
Bye,
bearophile
Sun, 04 Oct 2009 17:39:50 -0400, Justin Johansson thusly wrote:
> Nick Sabalausky Wrote:
>> "I've also
>> been wondering if it might be a huge benefit for distinguishing between
>> strings that represent a filename vs file content vs
>> file-extention-only vs relative-path+filename, vs absolute-pa
Andrei Alexandrescu:
>please name five remarkable complex literals.<
I agree that having a syntax is often not necessary (but it may be handy).
Complex literals in a program can be unremarkable too, they can be arguments of
complex functions, integration intervals, default values that replace mi
Nick Sabalausky Wrote:
> "Justin Johansson" wrote in message
> news:haavf1$2gs...@digitalmars.com...
> >
> > It's a difficult challenge to get high performance, readable and
> > maintainable code out of complex number
> > intensive algorithms. Use of library types for complex numbers has, in
bearophile wrote:
Walter Bright:
The big reason for moving it to a library type is the user defined
type capabilities of D have grown to the point where there is no
longer much of any advantage to having it built in.
If the compiler/language is now flexible enough to allow the creation
of a v
Nick Sabalausky wrote:
"Justin Johansson" wrote in message
news:haavf1$2gs...@digitalmars.com...
It's a difficult challenge to get high performance, readable and
maintainable code out of complex number
intensive algorithms. Use of library types for complex numbers has, in
my experience been
Walter Bright:
> The
> big reason for moving it to a library type is the user defined type
> capabilities of D have grown to the point where there is no longer much
> of any advantage to having it built in.
If the compiler/language is now flexible enough to allow the creation of a very
good c
"Justin Johansson" wrote in message
news:haavf1$2gs...@digitalmars.com...
>
> It's a difficult challenge to get high performance, readable and
> maintainable code out of complex number
> intensive algorithms. Use of library types for complex numbers has, in
> my experience been problematic.
>
Jeremie Pelletier Wrote:
> Walter Bright wrote:
> > Jeremie Pelletier wrote:
> >> language_fan wrote:
> >>> I admitted that later. Some of the keywords have a strong
> >>> justification behind them. Others feel irritatingly unnecessary.
> >>
> >> I would rather have many different specialized key
Jeremie Pelletier wrote:
Walter Bright wrote:
Also, the complex and imaginary types will be removed at some point
and replaced with a library type; there goes 6 keywords.
Why? What's the rationale behind such a move? These types will always be
handled the same no matter what library implement
Walter Bright wrote:
Jeremie Pelletier wrote:
language_fan wrote:
I admitted that later. Some of the keywords have a strong
justification behind them. Others feel irritatingly unnecessary.
I would rather have many different specialized keywords than a few
keywords with many different meaning
Nick Sabalausky wrote:
Fair enough. *But*, I really think "elegantly simple" language design is
double-edged sword. In my experience, and I think this is what Jeremie was
alluding to, I've found that an "elegantly simple" language, no matter how
well-chosen the primitives are, generally results
Jeremie Pelletier wrote:
language_fan wrote:
I admitted that later. Some of the keywords have a strong
justification behind them. Others feel irritatingly unnecessary.
I would rather have many different specialized keywords than a few
keywords with many different meanings. Its *much* easier t
Sun, 04 Oct 2009 11:08:52 -0500, Andrei Alexandrescu thusly wrote:
> So, you say D lacks built-in
> first-class sum and product types. Yet Tuple is a product type. In spite
> of appearances, it's a built-in type, just that it has no literal.
Not true. A tuple of tuples, for instance, breaks the p
language_fan wrote:
On Sun, 04 Oct 2009 04:28:35 -0500, Andrei Alexandrescu wrote:
language_fan wrote:
On Sat, 03 Oct 2009 16:39:29 -0400, Justin Johansson wrote:
People might remember that when I picked up D and joined this forum
just some 3 or so weeks ago I made mention of being a Scala
r
language_fan wrote:
On Sun, 04 Oct 2009 11:51:13 +0200, Lutger wrote:
How do you think Scala is going to manage to be a popular alternative
for Java by requiring its user to read books about lambda calculus?
It's not necessary. Often removing extra semicolons and changing the form
' ' to ' :
language_fan wrote:
On Sun, 04 Oct 2009 04:28:35 -0500, Andrei Alexandrescu wrote:
language_fan wrote:
On Sat, 03 Oct 2009 16:39:29 -0400, Justin Johansson wrote:
People might remember that when I picked up D and joined this forum
just some 3 or so weeks ago I made mention of being a Scala
r
On Sun, 04 Oct 2009 11:51:13 +0200, Lutger wrote:
> How do you think Scala is going to manage to be a popular alternative
> for Java by requiring its user to read books about lambda calculus?
It's not necessary. Often removing extra semicolons and changing the form
' ' to ' : ' suffices. Especia
On Sun, 04 Oct 2009 04:28:35 -0500, Andrei Alexandrescu wrote:
> language_fan wrote:
>> On Sat, 03 Oct 2009 16:39:29 -0400, Justin Johansson wrote:
>>
>>> People might remember that when I picked up D and joined this forum
>>> just some 3 or so weeks ago I made mention of being a Scala
>>> refuge
Forget to qualify my reply: I don't know Scala so you might as well be right
and I do not mean to say that D isn't a complex language.
language_fan wrote:
> On Sat, 03 Oct 2009 16:39:29 -0400, Justin Johansson wrote:
>
>> People might remember that when I picked up D and joined this forum just
>> some 3 or so weeks ago I made mention of being a Scala refugee.*** When
>> asked what I didn't like about Scala I commented about the
language_fan wrote:
On Sat, 03 Oct 2009 16:39:29 -0400, Justin Johansson wrote:
People might remember that when I picked up D and joined this forum just
some 3 or so weeks ago I made mention of being a Scala refugee.*** When
asked what I didn't like about Scala I commented about there being to
On Sat, 03 Oct 2009 16:39:29 -0400, Justin Johansson wrote:
> People might remember that when I picked up D and joined this forum just
> some 3 or so weeks ago I made mention of being a Scala refugee.*** When
> asked what I didn't like about Scala I commented about there being too
> many language
"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
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
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
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
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
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
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
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
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
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/
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
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
"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
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 mainstream,
> and I feel
language_fan wrote:
Fri, 02 Oct 2009 10:30:24 -0400, Jarrett Billingsley thusly wrote:
I always think it's funny when people are like "so, I had this idea,
lemme throw this out there. I know it sounds weird, but just bear with
me - what if there were _no null_? Did I just _blow your mind?_"
An
Fri, 02 Oct 2009 10:30:24 -0400, Jarrett Billingsley thusly wrote:
> I always think it's funny when people are like "so, I had this idea,
> lemme throw this out there. I know it sounds weird, but just bear with
> me - what if there were _no null_? Did I just _blow your mind?_"
>
> And the perspec
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 any two mouse c
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
-- Justin Johansson
Most o
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 very interesting point that
On Fri, Oct 2, 2009 at 8:13 AM, 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
I al
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
Most of the bugs he expose are trivial to debug and
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
bearophile Wrote:
> Max Samukha:
>
> > Don't get confused by 'new' in struct initializers. Structs in C# are
> > value types.
>
> Yes, you are right.
>
> But in D structs can be allocated on the heap too, so I think having optional
> nonnull
> struct pointers can be useful. The syntax and usag
Thanks Don! \o/
Dejan Lekic wrote:
Walter, is that article publicly available?
http://www.codeproject.com/KB/cpp/FastDelegate.aspx
Walter, is that article publicly available?
language_fan wrote:
Wed, 30 Sep 2009 12:05:29 -0400, Jeremie Pelletier thusly wrote:
Don wrote:
Greater risks come from using more complicated algorithms. Brute-force
algorithms are always the easiest ones to get right .
I'm not sure I agree with that. Those algorithms are pretty isolated and
Jeremie Pelletier wrote:
Don wrote:
Jeremie Pelletier wrote:
Yigal Chripun wrote:
On 29/09/2009 16:41, Jeremie Pelletier wrote:
What I argued about was your view on today's software being too big
and
complex to bother optimize it.
that is not what I said.
I was saying that hand optimized
Yigal Chripun wrote:
On 30/09/2009 18:44, bearophile wrote:
Max Samukha:
Don't get confused by 'new' in struct initializers. Structs in C# are
value types.
Yes, you are right.
But in D structs can be allocated on the heap too, so I think having
optional nonnull struct pointers can be usefu
On 30/09/2009 18:44, bearophile wrote:
Max Samukha:
Don't get confused by 'new' in struct initializers. Structs in C# are
value types.
Yes, you are right.
But in D structs can be allocated on the heap too, so I think having optional
nonnull struct pointers can be useful. The syntax and usag
On 30/09/2009 16:53, Jeremie Pelletier wrote:
Yigal Chripun wrote:
On 29/09/2009 16:41, Jeremie Pelletier wrote:
What I argued about was your view on today's software being too big and
complex to bother optimize it.
that is not what I said.
I was saying that hand optimized code needs to be
Michel Fortin:
> For a return value it's
> more troublesome because you're implicitly adding a promise that the
> function will not return null, and you might not realize it's wrong
> until it does indeed return null and your program crashes with a
> segfault.
I see.
It's a matter of how much
language_fan wrote:
Wed, 30 Sep 2009 17:05:18 -0400, Jeremie Pelletier thusly wrote:
language_fan wrote:
Wed, 30 Sep 2009 12:05:29 -0400, Jeremie Pelletier thusly wrote:
Don wrote:
Greater risks come from using more complicated algorithms.
Brute-force algorithms are always the easiest ones
Wed, 30 Sep 2009 17:05:18 -0400, Jeremie Pelletier thusly wrote:
> language_fan wrote:
>> Wed, 30 Sep 2009 12:05:29 -0400, Jeremie Pelletier thusly wrote:
>>
>>> Don wrote:
Greater risks come from using more complicated algorithms.
Brute-force algorithms are always the easiest ones to g
On 2009-09-30 15:30:02 -0400, "Denis Koroskin" <2kor...@gmail.com> said:
Note that C stdlib (and other libraries/bindings) will need to be
updated to reflect changes, e.g.
extern(C) void*? malloc(size_t size); // may return null!
which is great because it will provide additional safety. I've
language_fan wrote:
Wed, 30 Sep 2009 12:05:29 -0400, Jeremie Pelletier thusly wrote:
Don wrote:
Greater risks come from using more complicated algorithms. Brute-force
algorithms are always the easiest ones to get right .
I'm not sure I agree with that. Those algorithms are pretty isolated and
Saaa wrote:
Andrei Alexandrescu wrote
I wonder whether this would be a good topic for TDPL. Currently I'm
thinking it's too low-level. I do plan to insert a short section about
implementation, just not go deep inside the object model.
Andrei
I'd really love to see more about implementations
Wed, 30 Sep 2009 12:05:29 -0400, Jeremie Pelletier thusly wrote:
> Don wrote:
>> Greater risks come from using more complicated algorithms. Brute-force
>> algorithms are always the easiest ones to get right .
>
> I'm not sure I agree with that. Those algorithms are pretty isolated and
> really ea
On Wed, Sep 30, 2009 at 3:30 PM, Denis Koroskin <2kor...@gmail.com> wrote:
> Note that C stdlib (and other libraries/bindings) will need to be updated to
> reflect changes, e.g.
>
> extern(C) void*? malloc(size_t size); // may return null!
>
> which is great because it will provide additional safe
On Wed, 30 Sep 2009 23:08:40 +0400, Jarrett Billingsley
wrote:
On Wed, Sep 30, 2009 at 12:44 PM, bearophile
wrote:
Max Samukha:
Don't get confused by 'new' in struct initializers. Structs in C# are
value types.
Yes, you are right.
But in D structs can be allocated on the heap too, so
On Wed, Sep 30, 2009 at 12:44 PM, bearophile wrote:
> Max Samukha:
>
>> Don't get confused by 'new' in struct initializers. Structs in C# are
>> value types.
>
> Yes, you are right.
>
> But in D structs can be allocated on the heap too, so I think having optional
> nonnull struct pointers can be
1 - 100 of 363 matches
Mail list logo