On 2010-11-16 01:10, Daniel Murphy wrote:
I think allowing the second expression in the ternary operator to be omitted
would be a better fit for D, and provide the same function.
ie.
auto x = a ? a : b;
auto x = a ? : b;
Personally I had '|||' in mind, but I'm OK with '?:'. I think it should
Why do not you update it? GDC has been updated to dmd2.049 .
Why don't you contribute? It's a lot of work.
On Mon, 15 Nov 2010 12:32:07 -0800
Jonathan M Davis wrote:
> On Monday 15 November 2010 11:44:11 spir wrote:
> > On Mon, 15 Nov 2010 09:45:26 -0800
> >
> > Jonathan M Davis wrote:
> > > On Monday, November 15, 2010 06:00:33 Manfred_Nowak wrote:
> > > > Jonathan M Davis wrote:
> > > > > Having p
Am 16.11.2010 03:33, schrieb DOLIVE:
Why do not you update it? GDC has been updated to dmd2.049 .
please, please - learn a little bit more english
all your posts are just sounding like commands
spir:
> (and bug-prone, because sometimes the absence of a fields seems not caught,
> for any reason), so I add fields to the top type.
What do you mean? Do you have an example?
(Adding fields to the top type doesn't look like a good idea, generally).
Bye,
bearophile
== Quote from dennis luehring (dl.so...@gmx.net)'s article
> Am 16.11.2010 03:33, schrieb DOLIVE:
> > Why do not you update it? GDC has been updated to dmd2.049 .
> please, please - learn a little bit more english
pour qui?
On Tue, 16 Nov 2010 09:44:06 +0100
Per Ångström wrote:
> On 2010-11-16 01:10, Daniel Murphy wrote:
> > I think allowing the second expression in the ternary operator to be omitted
> > would be a better fit for D, and provide the same function.
> >
> > ie.
> > auto x = a ? a : b;
> > auto x = a ?
dennis luehring ôµ½:
> Am 16.11.2010 03:33, schrieb DOLIVE:
> > Why do not you update it? GDC has been updated to dmd2.049 .
>
> please, please - learn a little bit more english
> all your posts are just sounding like commands
haha... : )
dennis luehring ôµ½:
> Am 16.11.2010 03:33, schrieb DOLIVE:
> > Why do not you update it? GDC has been updated to dmd2.049 .
>
> please, please - learn a little bit more english
> all your posts are just sounding like commands
haha... sory ! : )
On Tue, 16 Nov 2010 05:37:52 -0500
bearophile wrote:
> spir:
>
> > (and bug-prone, because sometimes the absence of a fields seems not caught,
> > for any reason), so I add fields to the top type.
>
> What do you mean? Do you have an example?
> (Adding fields to the top type doesn't look like
On Tue, 16 Nov 2010 05:37:52 -0500
bearophile wrote:
> spir:
>
> > (and bug-prone, because sometimes the absence of a fields seems not caught,
> > for any reason), so I add fields to the top type.
>
> What do you mean? Do you have an example?
> (Adding fields to the top type doesn't look like
On Mon, 15 Nov 2010 17:02:27 -0500, bearophile
wrote:
Steven Schveighoffer:
To have the language continually working against that goal is going to
great for inexperienced programmers but hell for people trying to
squeeze performance out of it.<
The experienced programmers may write "sc
On 16.11.2010 14:40, spir wrote:
On Tue, 16 Nov 2010 05:37:52 -0500
bearophile wrote:
spir:
(and bug-prone, because sometimes the absence of a fields seems not caught, for
any reason), so I add fields to the top type.
What do you mean? Do you have an example?
(Adding fields to the top type
Daniel Murphy, el 16 de noviembre a las 10:10 me escribiste:
> "Per �ngstr�m" wrote in message
> news:ibr8bs$22m...@digitalmars.com...
> > return s || "default";
>
> I think allowing the second expression in the ternary operator to be omitted
> would be a better fit for D, and provide the s
Graham Fawcett Wrote:
> On Fri, 12 Nov 2010 18:15:15 -0500, Sean Kelly wrote:
> >
> > To be honest, I haven't spent much time with Go because my cursory
> > exposure to the language hasn't shown it to solve the problems I
> > care about better than the languages I currently use. I think Go is
> >
Kagamin wrote:
> Sean Kelly Wrote:
>
>>> shared uint cnt;
>>> void atomicInc ( ) { uint o; while ( !cas( &cnt, o, o + 1 ) ) o =
> > > cnt; }
>>>
>>> is compiled with dmd -O to something like:
>>>
>>> shared uint cnt;
>>> void atomicInc ( ) { while ( !cas( &cnt, cnt, cnt + 1 ) ) { } }
>> What
I'm trying to use remove() from std.algorithm to remove item from an
array and when I tried to use SwapStrategy.unstable (as I don't need
to maintain order of items in array and I want to optimize where ever
I can) I came to surprising results. In the example below one would
expect that item at ind
"Script mode" (actually - simple wrapper) would be better:
It could do simple parsing of script, bringing all "import" clauses to
the beginning and add some default imports (like std.stdio). It seems
that all code below imports can be wrapped into main declaration. So
for
writeln("hello, world!")
Hi,
I've noticed that the modulus operator acts differently when the divisor is
the length of an array and the dividend is negative.
For instance, this code:
import std.stdio;
const int x = 4;
void main(){
int[x] arr = [0, 1, 2, 3];
writeln("Using arr.length");
for(int i = -3; i <= 0
Hi,
assert(false) should generate the hlt instruction in release mode.
I.e.
assert.d:
void hlt() {
assert(false);
}
$ dmd -release -c assert.d
$ obj2asm assert.o | grep -w hlt
works. But
$ dmd -unittest -release -c assert.d
$ obj2asm assert.o | grep -w hlt
fails.
Can't one have hlt to
> "Script mode" (actually - simple wrapper) would be better:
> It could do simple parsing of script, bringing all "import"
> clauses to the beginning and add some default imports
> (like std.stdio). It seems that all code below imports can be
> wrapped into main declaration.
My rund.d program doe
DMD currently follows a fairly standard compiler methodology:
- Compile a bunch of source files into binary objects (to generate .o).
- Act as a front end to an archiver (to generate .a).
- Act as a front end to a linker (to generate final binary).
This makes integration with most build systems a
== Quote from Jens Mueller (jens.k.muel...@gmx.de)'s article
> Hi,
> assert(false) should generate the hlt instruction in release mode.
> I.e.
> assert.d:
> void hlt() {
> assert(false);
> }
> $ dmd -release -c assert.d
> $ obj2asm assert.o | grep -w hlt
> works. But
> $ dmd -unittest -releas
dsimcha wrote:
> == Quote from Jens Mueller (jens.k.muel...@gmx.de)'s article
> > Hi,
> > assert(false) should generate the hlt instruction in release mode.
> > I.e.
> > assert.d:
> > void hlt() {
> > assert(false);
> > }
> > $ dmd -release -c assert.d
> > $ obj2asm assert.o | grep -w hlt
> > w
Hi,
> I've noticed that the modulus operator acts differently when the divisor is
> the length of an array and the dividend is negative.
> For instance, this code:
>
> import std.stdio;
> const int x = 4;
> void main(){
> int[x] arr = [0, 1, 2, 3];
>
> writeln("Using arr.length");
>
Steven Schveighoffer:
> > The experienced programmers may write "scope int[] a...", and have no
> > heap allocations.
>
> This is a good idea. This isn't what I thought spir was saying, I thought
> he wanted the function to always allocate.
I have also suggested that when "scope" is not pre
On 11/16/10 4:40 AM, Steven Schveighoffer wrote:
On Mon, 15 Nov 2010 17:02:27 -0500, bearophile
wrote:
I have even suggested a transitive @noheap annotation, similar to
@nothrow, that makes sure a function contains no heap allocations and
doesn't call other things that perform heap allocations:
On 11/16/10 4:24 AM, Aleksandar Ružičić wrote:
I'm trying to use remove() from std.algorithm to remove item from an
array and when I tried to use SwapStrategy.unstable (as I don't need
to maintain order of items in array and I want to optimize where ever
I can) I came to surprising results. In th
Andrei Alexandrescu Wrote:
>
> I am sorry for the inadvertent change, it wasn't meant to change
> semantics of existing code. I'm not sure whether one of my unrelated
> 64-bit changes messed things up. You may want to file a bug report.
>
> There are a number of good reasons for which I was co
On Tue, 16 Nov 2010 10:55:24 -0500, David Osborne
wrote:
Hi,
I've noticed that the modulus operator acts differently when the divisor
is
the length of an array and the dividend is negative.
For instance, this code:
import std.stdio;
const int x = 4;
void main(){
int[x] arr = [0, 1, 2
On Tue, 16 Nov 2010 13:16:13 -0500, Steve Teale
wrote:
Andrei,
Maybe it is time that the structure of the standard library became more
generalized. At the moment we have std... and core...
Perhaps we need another branch in the hierarchy, like ranges... Then
there could be a std.range mo
On Tue, 16 Nov 2010 13:04:32 -0500, Andrei Alexandrescu
wrote:
On 11/16/10 4:40 AM, Steven Schveighoffer wrote:
On Mon, 15 Nov 2010 17:02:27 -0500, bearophile
wrote:
I have even suggested a transitive @noheap annotation, similar to
@nothrow, that makes sure a function contains no heap allo
Users who consider using these two modules in conjunction should beware of
clashes.
I used std.socketstream in a micro-server context to read the individual lines
of an http request.
After that I reverted to socket level to keep the connection open for some time
so that the client could re-use
Steven Schveighoffer Wrote:
> On Tue, 16 Nov 2010 13:16:13 -0500, Steve Teale
> wrote:
> >
> > Andrei,
> >
> > Maybe it is time that the structure of the standard library became more
> > generalized. At the moment we have std... and core...
> >
> > Perhaps we need another branch in the hierar
On 11/16/2010 01:30 PM, Steven Schveighoffer wrote:
On Tue, 16 Nov 2010 13:16:13 -0500, Steve Teale
wrote:
Andrei,
Maybe it is time that the structure of the standard library became
more generalized. At the moment we have std... and core...
Perhaps we need another branch in the hierarchy, li
Am 16.11.2010 18:38, schrieb Travis:
The one thing I have been wondering however is why doesn't DMD have a flag for
easy project building which compiles dependencies in a single command.
[...]
Thanks,
tbone
Have you tried 'rdmd' ?
I have moaned several times about the fact that this module does not have a
method for creating a date from the system clock.
It provides a parse method to convert a string in a limited number of formats.
In the course of doing that, it calls the OS primitive to get the time zone
offset.
So wh
On Tue, 16 Nov 2010 13:46:48 -0500, Steve Teale
wrote:
Steven Schveighoffer Wrote:
On Tue, 16 Nov 2010 13:16:13 -0500, Steve Teale
wrote:
>
> Andrei,
>
> Maybe it is time that the structure of the standard library became
more
> generalized. At the moment we have std... and core...
>
> P
On Tuesday, November 16, 2010 10:31:43 Steven Schveighoffer wrote:
> On Tue, 16 Nov 2010 13:04:32 -0500, Andrei Alexandrescu
>
> wrote:
> > On 11/16/10 4:40 AM, Steven Schveighoffer wrote:
> >> On Mon, 15 Nov 2010 17:02:27 -0500, bearophile
> >>
> >> wrote:
> >>> I have even suggested a transit
On 11/16/10 10:16 AM, Steve Teale wrote:
Andrei Alexandrescu Wrote:
I am sorry for the inadvertent change, it wasn't meant to change
semantics of existing code. I'm not sure whether one of my unrelated
64-bit changes messed things up. You may want to file a bug report.
There are a number of g
On Tue, 16 Nov 2010 14:11:05 -0500, Steve Teale
wrote:
I have moaned several times about the fact that this module does not
have a method for creating a date from the system clock.
It provides a parse method to convert a string in a limited number of
formats. In the course of doing that,
Steven Schveighoffer Wrote:
>>
> I'm guessing you are referring to php's pcre vs posix regex? I think
> posix is marked as deprecated...
>
Steve,
No. I just meant that the library that comes with PHP seems happy to provide
different ways of doing the same thing, as in for example, CURL, DOM
On Tuesday, November 16, 2010 10:30:03 Steven Schveighoffer wrote:
> The standard library should not have something to please everyone. If
> there is 5 different styles to do the same thing, it will be a failure.
Agreed. Ideally, the standard library would be very uniform in approach. That
makes
On 11/16/10 10:46 AM, Steve Teale wrote:
Steven Schveighoffer Wrote:
On Tue, 16 Nov 2010 13:16:13 -0500, Steve Teale
wrote:
Andrei,
Maybe it is time that the structure of the standard library became more
generalized. At the moment we have std... and core...
Perhaps we need another branch
No problem, just to isolate the code and to confirm it's not something
to other parts of my code (but I'm pretty sure it's not).
On Tue, Nov 16, 2010 at 7:03 PM, Andrei Alexandrescu
wrote:
> On 11/16/10 4:24 AM, Aleksandar Ružičić wrote:
>>
>> I'm trying to use remove() from std.algorithm to remo
On Tuesday, November 16, 2010 11:11:05 Steve Teale wrote:
> I have moaned several times about the fact that this module does not have a
> method for creating a date from the system clock.
>
> It provides a parse method to convert a string in a limited number of
> formats. In the course of doing th
filed as Issue #5224 - http://d.puremagic.com/issues/show_bug.cgi?id=5224
regards,
Aleksandar
2010/11/16 Aleksandar Ružičić :
> No problem, just to isolate the code and to confirm it's not something
> to other parts of my code (but I'm pretty sure it's not).
>
> On Tue, Nov 16, 2010 at 7:03 PM, A
On 11/13/2010 11:43 AM, Russel Winder wrote:
On Sat, 2010-11-13 at 08:18 +, Iain Buclaw wrote:
[ . . . ]
import std.typecons; ?
Hummm... I thought I had put that in but clearly I had not :-(( OK so
that explains the bulk of the problems on this code, I knew it was
something stupid on my p
Jonathan M Davis:
> Pure is hard enough to deal with (especially since it we probably have made
> it
> the default, but it's too late for that now).
Weakly pure on default isn't good for a language that is supposed to b e
somewhat compatible with C syntax, I think it breaks too many C function
I'm trying to use BinaryHeap in a multithreaded programming using
std.parallelism/parallelfuture. I kept getting ridiculous segfaults and
stuff, and when I looked into it in a debugger, I realized the crashes had to
do with reference counting, probably caused by this line in BinaryHeap:
priva
Steve Teale Wrote:
> It also strikes me as odd that it does not include a table of leap seconds.
> As it stands, some of its methods could return values that were out by a year
> for up to four or five seconds on January 1 2011. I'm no expert on UTC,
> Gregorian Calendar and such, so I could we
On Tuesday 16 November 2010 12:37:10 bearophile wrote:
> Jonathan M Davis:
> > Pure is hard enough to deal with (especially since it we probably have
> > made it the default, but it's too late for that now).
>
> Weakly pure on default isn't good for a language that is supposed to b e
> somewhat co
On Tue, 16 Nov 2010 11:24:02 -0800
Jonathan M Davis wrote:
> On Tuesday, November 16, 2010 10:30:03 Steven Schveighoffer wrote:
> > The standard library should not have something to please everyone. If
> > there is 5 different styles to do the same thing, it will be a failure.
>
> Agreed. Ideal
dsimcha:
> I think this is correct. The -unittest switch implicitly turns on asserts,
> and as
> far as I can tell makes the -release switch ignored. This means that
> assert(false) is no longer special and works just like a regular assert as
> per TDPL.
>
> Is this a problem in practice? If
Steve Teale:
> The current system, where modules of the library can get arbitrarily
> deprecated and at some point removed because they are unfashionable, is very
> unfriendly.
We are in the initial phase of Phobos develpment, so frequent large changes are
expected. Surely one year from now Ph
David Osborne wrote:
> Using arr.length
> -3 mod 3 = 1 <-- this should be 0
> -2 mod 3 = 2 <-- this should be 1
> -1 mod 3 = 0 <-- this should be 2
> 0 mod 3 = 0
Like others have said, this is due to the fact that when one
operand is unsigned (here the length), then all operands get cas
On 11/16/10 12:47 PM, dsimcha wrote:
I'm trying to use BinaryHeap in a multithreaded programming using
std.parallelism/parallelfuture. I kept getting ridiculous segfaults and
stuff, and when I looked into it in a debugger, I realized the crashes had to
do with reference counting, probably caused
Jérôme M. Berger Wrote:
> > -3 mod 3 = 0
> > -2 mod 3 = -2
> > -1 mod 3 = -1
> > 0 mod 3 = 0
>
> Note that from a strictly mathematical point of view, this result
> is valid: for all x and all n, x-(x%n) is a multiple of n.
It's rather (x/n)+(x%n)==x
I really think that it would be good to ship something like this with
dmd and promote it default "D script" handler.
May be, parsing must be more complicated (I'm not sure that all
features will work inside main()), but as D is easy for
parsing I see no big problems.Of cource, we can add more comp
Kagamin wrote:
> Jérôme M. Berger Wrote:
>
>>> -3 mod 3 = 0
>>> -2 mod 3 = -2
>>> -1 mod 3 = -1
>>> 0 mod 3 = 0
>> Note that from a strictly mathematical point of view, this result
>> is valid: for all x and all n, x-(x%n) is a multiple of n.
>
> It's rather (x/n)+(x%n)==x
That is (
Am 16.11.2010 18:09, schrieb Sean Kelly:
cas() contains an asm block. Though I guess in this case the compiler
isn't actually optimizing across it. Does atomic!"+="(&cnt, 1) work
correctly? I know the issue with shared would still have to be fixed,
but that code uses asm for the load as well, so
J. M. Berger:
> (bearophile probably has a bug report for it ;) )
Yup, bug 3843.
Bye,
bearophile
On 2010-11-16 15:47:07 -0500, dsimcha said:
I'm trying to use BinaryHeap in a multithreaded programming using
std.parallelism/parallelfuture. I kept getting ridiculous segfaults and
stuff, and when I looked into it in a debugger, I realized the crashes had to
do with reference counting, probab
Thanks for the info, everyone. I guess I'll just have to be more careful
what I use modulus with :)
~Dave
On Tuesday, November 16, 2010 03:40:24 spir wrote:
> On Tue, 16 Nov 2010 05:37:52 -0500
>
> bearophile wrote:
> > spir:
> > > (and bug-prone, because sometimes the absence of a fields seems not
> > > caught, for any reason), so I add fields to the top type.
> >
> > What do you mean? Do you have
On Tuesday, November 16, 2010 13:00:17 Kagamin wrote:
> Steve Teale Wrote:
> > It also strikes me as odd that it does not include a table of leap
> > seconds. As it stands, some of its methods could return values that were
> > out by a year for up to four or five seconds on January 1 2011. I'm no
>
On Tue, 16 Nov 2010 16:04:18 -0500, Jonathan M Davis
wrote:
On Tuesday 16 November 2010 12:37:10 bearophile wrote:
Jonathan M Davis:
> Pure is hard enough to deal with (especially since it we probably have
> made it the default, but it's too late for that now).
Weakly pure on default isn't
stephan Wrote:
> Am 16.11.2010 18:09, schrieb Sean Kelly:
> > cas() contains an asm block. Though I guess in this case the compiler
> > isn't actually optimizing across it. Does atomic!"+="(&cnt, 1) work
> > correctly? I know the issue with shared would still have to be fixed,
> > but that code u
On Tue, 16 Nov 2010 14:24:32 -0500, Steve Teale
wrote:
Steven Schveighoffer Wrote:
I'm guessing you are referring to php's pcre vs posix regex? I think
posix is marked as deprecated...
Steve,
No. I just meant that the library that comes with PHP seems happy to
provide different ways
On Tue, 16 Nov 2010 20:17:53 -0500, Jonathan M Davis
wrote:
(DST is one of the stupidest ideas even IMHO; I don't even
want to _think_ about how many bugs it's created)
No, the stupidest idea was to *change* DST a few years ago. That had
absolutely no purpose, I can't even believe we was
http://news.ycombinator.com/item?id=1912728
Andrei
On Tue, 16 Nov 2010 15:47:07 -0500, dsimcha wrote:
I'm trying to use BinaryHeap in a multithreaded programming using
std.parallelism/parallelfuture. I kept getting ridiculous segfaults and
stuff, and when I looked into it in a debugger, I realized the crashes
had to
do with reference counti
http://news.ycombinator.com/item?id=1912728
On Wed, 17 Nov 2010 00:10:54 -0500, Andrei Alexandrescu
wrote:
http://news.ycombinator.com/item?id=1912728
Andrei
"I like go because every single feature go has is the best ever!"
yawn...
-Steve
On 11/16/10 9:21 PM, Steven Schveighoffer wrote:
On Wed, 17 Nov 2010 00:10:54 -0500, Andrei Alexandrescu
wrote:
http://news.ycombinator.com/item?id=1912728
Andrei
"I like go because every single feature go has is the best ever!"
yawn...
-Steve
I'm curious what the response to my example
On Wed, 17 Nov 2010 00:24:50 -0500, Andrei Alexandrescu
wrote:
On 11/16/10 9:21 PM, Steven Schveighoffer wrote:
On Wed, 17 Nov 2010 00:10:54 -0500, Andrei Alexandrescu
wrote:
http://news.ycombinator.com/item?id=1912728
Andrei
"I like go because every single feature go has is the best e
On Tuesday 16 November 2010 21:08:48 Steven Schveighoffer wrote:
> On Tue, 16 Nov 2010 20:17:53 -0500, Jonathan M Davis
>
> wrote:
> > (DST is one of the stupidest ideas even IMHO; I don't even
> > want to _think_ about how many bugs it's created)
>
> No, the stupidest idea was to *change* DST a
On 11/16/10 9:58 PM, Steven Schveighoffer wrote:
On Wed, 17 Nov 2010 00:24:50 -0500, Andrei Alexandrescu
wrote:
On 11/16/10 9:21 PM, Steven Schveighoffer wrote:
On Wed, 17 Nov 2010 00:10:54 -0500, Andrei Alexandrescu
wrote:
http://news.ycombinator.com/item?id=1912728
Andrei
"I like go b
On 11/16/2010 22:24, Andrei Alexandrescu wrote:
> I'm curious what the response to my example will be. So far I got one
> that doesn't even address it.
I really don't see the problem with requiring that '{' goes on the same
line as 'if'. It's something you learn once and never forget because it
i
On 11/16/2010 21:53, Steven Schveighoffer wrote:
> It makes me think that this is going to be extremely confusing for a
> while, because people are so used to pure being equated with a
> functional language, so when they see a function is pure but takes
> mutable data, they will be scratching their
On Tuesday 16 November 2010 20:53:04 Steven Schveighoffer wrote:
> On Tue, 16 Nov 2010 16:04:18 -0500, Jonathan M Davis
>
> wrote:
> > On Tuesday 16 November 2010 12:37:10 bearophile wrote:
> >> Jonathan M Davis:
> >> > Pure is hard enough to deal with (especially since it we probably have
> >> >
On Tuesday 16 November 2010 23:03:05 Rainer Deyke wrote:
> On 11/16/2010 21:53, Steven Schveighoffer wrote:
> > It makes me think that this is going to be extremely confusing for a
> > while, because people are so used to pure being equated with a
> > functional language, so when they see a functio
On Tuesday 16 November 2010 22:55:42 Rainer Deyke wrote:
> On 11/16/2010 22:24, Andrei Alexandrescu wrote:
> > I'm curious what the response to my example will be. So far I got one
> > that doesn't even address it.
>
> I really don't see the problem with requiring that '{' goes on the same
> line
Jonathan M Davis Wrote:
> Honestly, leap seconds are complete stupidity with regards to computers. They
> just complicate things.
I think, it's ok, computers work with nominal time and synchronize with world
as needed. Hardly you can catch a bug with leap seconds.
On Wed, 17 Nov 2010 00:58:28 -0500, Steven Schveighoffer wrote:
> On Wed, 17 Nov 2010 00:24:50 -0500, Andrei Alexandrescu
> wrote:
>
>> On 11/16/10 9:21 PM, Steven Schveighoffer wrote:
>>> On Wed, 17 Nov 2010 00:10:54 -0500, Andrei Alexandrescu
>>> wrote:
>>>
http://news.ycombinator.com/it
85 matches
Mail list logo