Hi PC,
Thanks for your kind words.
Regarding regex, we need to get a report into bugzilla so we keep track
of the problem. When you say disable the call to optimize are you
referring to the -O compiler flag? In that case it's a compiler problem
(otherwise it might be a library issue). Could
On 07/12/2010 12:12 AM, Eric Poggel wrote:
On 7/12/2010 12:46 AM, Rainer Deyke wrote:
On 7/11/2010 22:24, Vladimir Panteleev wrote:
But the same could be said about any language feature! Deprecating the
delete statement, and increasing the verbosity of the code for the sake
of customizability
On 07/11/2010 11:24 PM, Vladimir Panteleev wrote:
On Mon, 12 Jul 2010 00:00:46 +0300, bearophile
bearophileh...@lycos.com wrote:
A std lib function is not set in stone, later it can be improved,
modified, etc.
But the same could be said about any language feature! Deprecating the
delete
On 07/12/2010 12:45 AM, Philippe Sigaud wrote:
On Mon, Jul 12, 2010 at 03:17, Andrei Alexandrescu
seewebsiteforem...@erdani.org mailto:seewebsiteforem...@erdani.org
wrote:
In related news, there's been this burning desire regarding a
lightweight output range defined as simply a delegate
Ellery Newcomer wrote:
On 07/11/2010 06:57 PM, retard wrote:
Sun, 11 Jul 2010 22:03:56 +, pillsy wrote:
== Quote from Don (nos...@nospam.com)'s article
Philippe Sigaud wrote:
[...]
String mixins sure are powerful, but I can't get ird of a feeling of
'cheating' when using them. Maybe
On 2010-07-12 05:03:06 +0200, Petr said:
Ok, so I now know how to explicitly free memory allocated to the GC
heap. Now the question is, should we have the usual C* c = new C(), and
I wanted to allocate it to unmanaged memory(just like it would in C++)
and then at some
point call the
On Sun, 11 Jul 2010 07:01:49 -0400, Don nos...@nospam.com wrote:
retard wrote:
Thu, 08 Jul 2010 21:43:57 -0400, Robert Jacques wrote:
Check out Walter's slides and/or talk from the D conference.
(http://www.digitalmars.com/webnews/newsgroups.php?
On 09/07/2010 14:04, Steven Schveighoffer wrote:
Have you tried using composition?
Thanks fro feedback Steve.
No, NO Chance.
The composite pattern requires inheritances (and the use of the
composite pattern does not makes sense in our case) but also my
idea of using the decorator
Steven Schveighoffer:
If people agree that AST macros are superseded by mixins,
String mixins are a hack, just a bit better than C preprocessor (because they
are scoped), they are not a replacement of clean macros.
Bye,
bearophile
A video, Large-Scale Static Analysis of C++ code at Mozilla, video, July 9th,
2010:
http://vimeo.com/12614626
From the video I have seen that Mozilla developers have felt the need to add
this new attribute in C++ (implemented in JavaScript through their hydra
plug-ins and used with a define
On Sat, 10 Jul 2010 01:06:39 -0400, Jonathan M Davis
jmdavisp...@gmail.com wrote:
I thought that classes always went on the heap and that structs always
went on
the stack - so allocating structs with new wouldn't work. Also, I
thought that
delete was deprecated if not outright removed from
???
I mean docking, tabbed MDI, advanced data bound hierarchical grids
(using active records, and Enterprise patterns ), charts, reporting etc..
Please let me know.
Bjoern
On Mon, 12 Jul 2010 08:12:31 -0400, bearophile bearophileh...@lycos.com
wrote:
Steven Schveighoffer:
If people agree that AST macros are superseded by mixins,
String mixins are a hack, just a bit better than C preprocessor (because
they are scoped), they are not a replacement of clean
On Mon, 12 Jul 2010 02:21:25 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
On 07/12/2010 12:45 AM, Philippe Sigaud wrote:
On Mon, Jul 12, 2010 at 03:17, Andrei Alexandrescu
seewebsiteforem...@erdani.org mailto:seewebsiteforem...@erdani.org
wrote:
In related news,
bearophile wrote:
Justin Johansson:
With care? That doesn't say very much except for possibly an
unintended suggestion that the OP is not trying to use care.
He is posting because he does care.
I probably meant something different.
What I meant is just that one of the main purposes of a GC
On Mon, 12 Jul 2010 09:33:34 -0400, Ellery Newcomer
ellery-newco...@utulsa.edu wrote:
On 07/12/2010 07:30 AM, Steven Schveighoffer wrote:
On Mon, 12 Jul 2010 08:12:31 -0400, bearophile
bearophileh...@lycos.com wrote:
Steven Schveighoffer:
If people agree that AST macros are superseded by
On 07/12/2010 07:27 AM, Steven Schveighoffer wrote:
Also, the example given in the bug report is very simplistic, just to
demonstrate the problem. Does anyone have a good use case for struct
dtors being called when allocated by the GC? All of the struct dtors
I've seen assume they are
On 07/12/2010 07:15 AM, bearophile wrote:
A video, Large-Scale Static Analysis of C++ code at Mozilla, video, July 9th,
2010:
http://vimeo.com/12614626
From the video I have seen that Mozilla developers have felt the need to add
this new attribute in C++ (implemented in JavaScript through
On 07/12/2010 07:44 AM, Steven Schveighoffer wrote:
On Mon, 12 Jul 2010 02:21:25 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
On 07/12/2010 12:45 AM, Philippe Sigaud wrote:
On Mon, Jul 12, 2010 at 03:17, Andrei Alexandrescu
seewebsiteforem...@erdani.org
I just want to suggest renaming foreach_reverse keyword to rforeach. My main
concern is to remove the underscore in the keyword and also to speedup the
typing if the programmer is using a text editor. Is this suggestion
acceptable to others?
--
-Arth
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article
On Mon, 12 Jul 2010 09:33:34 -0400, Ellery Newcomer
ellery-newco...@utulsa.edu wrote:
[...]
I think the big thing about macros is you don't have to
worry about lexing and parsing.
if A is of the form (Assignable,
On Mon, 12 Jul 2010 10:41:51 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
On 07/12/2010 07:44 AM, Steven Schveighoffer wrote:
On Mon, 12 Jul 2010 02:21:25 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
On 07/12/2010 12:45 AM, Philippe Sigaud wrote:
On
On 07/12/2010 09:59 AM, Steven Schveighoffer wrote:
On Mon, 12 Jul 2010 10:41:51 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
On 07/12/2010 07:44 AM, Steven Schveighoffer wrote:
On Mon, 12 Jul 2010 02:21:25 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
Just saw this on reddit:
http://www.reddit.com/r/programming/comments/cocww/little_known_c_feature_conditional_attributes/
and was wondering whether this can be done in D by relying on lazy
parameters and the inliner. Here's the test bed:
void log(A...)(lazy string format, lazy A objects)
{
On 07/12/2010 09:57 AM, pillsy wrote:
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article
On Mon, 12 Jul 2010 09:33:34 -0400, Ellery Newcomer
ellery-newco...@utulsa.edu wrote:
[...]
I think the big thing about macros is you don't have to
worry about lexing and parsing.
ifA
On 2010-07-12 10:36:05 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org said:
On 07/12/2010 07:15 AM, bearophile wrote:
A video, Large-Scale Static Analysis of C++ code at Mozilla, video,
July 9th, 2010:
http://vimeo.com/12614626
From the video I have seen that Mozilla developers
Just though I'd post here on something that made me question my sanity late
one night.
I was working on some test code and for some reason put parens around
myArray.reverse. After that the compiler complained that reverse was an
unknown identifier. It took me about 30 minutes at 2am to finally
Assuming -unittest is asserted, should a D compiler generate and run unittest
code for classes that have unittests, but don't reference the class during
execution?
I noticed that gdc does compile them in, but the current version of ldc doesn't.
eris
On Mon, 12 Jul 2010 11:05:33 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
On 07/12/2010 09:59 AM, Steven Schveighoffer wrote:
If I always have to do something like this in order to append a single
element:
put(r, (elem)[0..1]);
No, the library does that. Look here:
On Mon, 12 Jul 2010 12:16:32 -0400, eris jvbur...@gmail.com wrote:
Just though I'd post here on something that made me question my sanity
late
one night.
I was working on some test code and for some reason put parens around
myArray.reverse. After that the compiler complained that reverse
Slight clarification of unittest behavior:
- ldc will compile the unittest as long as a single reference to the class
remains
- gdc will compile the unittest regardless
ie:
class A { void hello() { Stdout(hello); }
unittest { A myobj; myobj = new A(); a.hello() }
void main() {
A
On 07/12/2010 11:53 AM, Steven Schveighoffer wrote:
On Mon, 12 Jul 2010 12:16:32 -0400, eris jvbur...@gmail.com wrote:
Just though I'd post here on something that made me question my sanity
late
one night.
I was working on some test code and for some reason put parens around
myArray.reverse.
On Monday, July 12, 2010 07:20:06 Arth Lloyd Flores wrote:
I just want to suggest renaming foreach_reverse keyword to rforeach. My
main concern is to remove the underscore in the keyword and also to
speedup the typing if the programmer is using a text editor. Is this
suggestion acceptable to
On 12.07.2010 18:48, Steven Schveighoffer wrote:
[...]
So what happens when you call put(r, e) for one of these output
classes? Instead of just calling add(e), it calls (add((e)[0..1]))
which in turn goes through some needless loop, which then ends up
calling add(e). I don't see why this is
On Mon, 12 Jul 2010 13:43:18 -0400, torhu n...@spam.invalid wrote:
On 12.07.2010 18:48, Steven Schveighoffer wrote:
[...]
So what happens when you call put(r, e) for one of these output
classes? Instead of just calling add(e), it calls (add((e)[0..1]))
which in turn goes through some needless
On 07/12/2010 12:55 PM, Steven Schveighoffer wrote:
On Mon, 12 Jul 2010 13:43:18 -0400, torhu n...@spam.invalid wrote:
On 12.07.2010 18:48, Steven Schveighoffer wrote:
[...]
So what happens when you call put(r, e) for one of these output
classes? Instead of just calling add(e), it calls
On 07/12/2010 01:10 PM, Walter Bright wrote:
Andrei Alexandrescu wrote:
Just saw this on reddit:
http://www.reddit.com/r/programming/comments/cocww/little_known_c_feature_conditional_attributes/
and was wondering whether this can be done in D by relying on lazy
parameters and the inliner.
Great stuff. Should be on D website under language reference.
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article
On 07/12/2010 12:55 PM, Steven Schveighoffer wrote:
On Mon, 12 Jul 2010 13:43:18 -0400, torhu n...@spam.invalid wrote:
On 12.07.2010 18:48, Steven Schveighoffer wrote:
[...]
So what happens when you call put(r,
On Mon, 12 Jul 2010 13:49:50 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
On 07/12/2010 11:48 AM, Steven Schveighoffer wrote:
On Mon, 12 Jul 2010 11:05:33 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
On 07/12/2010 09:59 AM, Steven Schveighoffer wrote:
On Mon, 12 Jul 2010 12:38:47 -0400, eris jvbur...@gmail.com wrote:
Assuming -unittest is asserted, should a D compiler generate and run
unittest
code for classes that have unittests, but don't reference the class
during
execution?
I noticed that gdc does compile them in, but the current
Andrei Alexandrescu wrote:
Yes. The point is that with a delegate you must choose between accepting
E and E[]. Given the constraint, it's better for everyone to accept E[]
and let put() take care of the occasional E by doing the wraparoo
(elem)[0..1].
I don't think the current implementation
On 07/12/2010 01:31 PM, dsimcha wrote:
But efficiency only matters some of the time, assuming the kind of inefficiency
in
question is small constant term inefficiency (as is the case here) and not O(N!)
inefficiency or 1000-fold constant term inefficiency.
Historically the constant was large.
== Quote from Andrei Alexandrescu (seewebsiteforem...@erdani.org)'s article
On 07/12/2010 01:31 PM, dsimcha wrote:
But efficiency only matters some of the time, assuming the kind of
inefficiency in
question is small constant term inefficiency (as is the case here) and not
O(N!)
Andrei Alexandrescu:
sort is all but deprecated, since std.algorithm.sort exists.
reverse could even more easily be implemented as a library function than
sort, it should be removed as well.
http://www.digitalmars.com/d/2.0/phobos/std_algorithm.html#reverse
D site can enjoy a page that
In the D.learn nesgroup Heywood Floyd has started a short thread about 2D
arrays definition, he finds them confusing, and he currently wants to use the
int marr[3][5]; syntax.
It's not good to have two different syntaxes to define arrays in a language,
but I too have found the C-style syntax
On 07/12/2010 02:28 PM, bearophile wrote:
Andrei Alexandrescu:
sort is all but deprecated, since std.algorithm.sort exists.
reverse could even more easily be implemented as a library
function than sort, it should be removed as well.
On Mon, 12 Jul 2010 15:18:17 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
On 07/12/2010 01:47 PM, Steven Schveighoffer wrote:
On Mon, 12 Jul 2010 13:49:50 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
Yes. The point is that with a delegate you must
Andrei Alexandrescu:
std.conv - std.conversion
OK.
std.stdio - std.io
OK.
put(R, E) - putNext(R, E)
Uhm. I don't like this a lot.
BidirectionalRange - DoublyEndedRange
Acceptable.
More suggestions:
std.cover = std.coverage
Rationale: this module is not used very often, so by Zipf
Andrei Alexandrescu:
Statically disabling new for structs with dtors - that's an interesting
idea.
In this bug report, comment 6, I have asked for a warning, but turning it into
an error can work too :-)
http://d.puremagic.com/issues/show_bug.cgi?id=2834
Bye,
bearophile
I know that large structs are generally returned from functions by the caller
passing in a hidden pointer. Assuming the function is not inlined, is this
cost mitigated in any way if the return value is not used? In other words, if
the return value is not used, then is returning a large struct
On Mon, 12 Jul 2010 10:32:47 -0700, Jonathan M Davis
jmdavisp...@gmail.com wrote:
I just want to suggest renaming foreach_reverse keyword to
rforeach. My
To easy to miss type foreach to rforeach, with r and f next to each
other. This may lead to bugs.
Steven Schveighoffer:
bearophile:
String mixins are a hack, just a bit better than C preprocessor (because
they are scoped), they are not a replacement of clean macros.
Interesting statement, can you back it up? :) What can you do with a
macro that you can't do with a mixin?
In the
On 2010-07-12 13:49:50 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org said:
The point is that with a delegate you must choose between accepting E
and E[]. Given the constraint, it's better for everyone to accept E[]
and let put() take care of the occasional E by doing the wraparoo
On 12/07/2010 03:17, Andrei Alexandrescu wrote:
he notion of output range has been a tad vague in the past; up until now
a range that wanted to qualify as an output range had to define a method
called put.
What if we have to deal with non orthogonal structures, or .. simple
directed graphs ?
On Mon, 12 Jul 2010 16:22:28 -0400, bearophile bearophileh...@lycos.com
wrote:
Steven Schveighoffer:
bearophile:
String mixins are a hack, just a bit better than C preprocessor
(because
they are scoped), they are not a replacement of clean macros.
Interesting statement, can you back it
On 07/12/2010 02:41 PM, Steven Schveighoffer wrote:
I'm unsure how it will work either. I admit now that I didn't think
through how this will be used.
It's very simple. As far as a user of an output range is concerned, they
should write stuff like:
put(r, '[');
char[] someBuf;
put(r,
Found with Reddit, shows some interesting experiments and timings that can be
useful for improvements in the implementation of D associative arrays:
http://www.pvk.ca/Blog/LowLevel/more_to_locality_than_cache.html
Bye,
bearophile
On Mon, 12 Jul 2010 17:25:43 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
On 07/12/2010 02:41 PM, Steven Schveighoffer wrote:
I'm unsure how it will work either. I admit now that I didn't think
through how this will be used.
It's very simple. As far as a user of an
Sorry about the lack of clarity in the last post. I actually
commented out the call to the Regex.optimize in Regex.compile.
auto r1 = regex( (a*)b );
r1.printProgram();
Prints out:
printProgram()
0:REtestbit 98, 13
18:REparen len=15 n=0, pc=42
27:REnm len=2, n=0,
On 07/12/2010 04:39 PM, Steven Schveighoffer wrote:
On Mon, 12 Jul 2010 17:25:43 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
On 07/12/2010 02:41 PM, Steven Schveighoffer wrote:
I'm unsure how it will work either. I admit now that I didn't think
through how this will be
On 07/12/2010 03:22 PM, bearophile wrote:
Steven Schveighoffer:
bearophile:
String mixins are a hack, just a bit better than C preprocessor
(because they are scoped), they are not a replacement of clean
macros.
Interesting statement, can you back it up? :) What can you do with
a macro that
On Monday, July 12, 2010 12:42:49 Andrei Alexandrescu wrote:
On 07/12/2010 02:28 PM, bearophile wrote:
Andrei Alexandrescu:
sort is all but deprecated, since std.algorithm.sort exists.
reverse could even more easily be implemented as a library
function than sort, it should be removed
Steven Schveighoffer schvei...@yahoo.com wrote in message
news:op.vfq0aydoeav...@localhost.localdomain...
On Mon, 12 Jul 2010 16:22:28 -0400, bearophile bearophileh...@lycos.com
wrote:
Steven Schveighoffer:
bearophile:
String mixins are a hack, just a bit better than C preprocessor
Hi everyone,
I don't know if it's a bug or not .. but D or at least its GC doesn't want to
free my allocated stuff! Also when I 'disable' the GC via GC.disable(); it
won't free it :-/
byte[] asdf=new byte[50_000_000]; // OK a bit much---but it's an example value
GC.free(asdf); // It doesn't
Andrei Alexandrescu seewebsiteforem...@erdani.org wrote in message
news:i1g5aq$2vk...@digitalmars.com...
Back on topic: http://www.apl.jhu.edu/~hall/Lisp-Notes/Macros.html.
Compare the simple macro in the beginning and the correct macro at the
end.
I can't read ordinary lisp, but
Andrei Alexandrescu:
Back on topic: http://www.apl.jhu.edu/~hall/Lisp-Notes/Macros.html.
Compare the simple macro in the beginning and the correct macro at the end.
CLisp macros are messy, they can be not easy to read and understand, and worse
of all they can fragment the community because
bearophile bearophileh...@lycos.com wrote in message
news:i1fs3g$2ev...@digitalmars.com...
Andrei Alexandrescu:
std.stdio - std.io
I think this was brought up before and Walter didn't like it because he felt
that putting it in the std package didn't make it blatantly obvious that
it was
== Quote from Steven Schveighoffer (schvei...@yahoo.com)'s article:
On Mon, 12 Jul 2010 16:22:28 -0400, bearophile bearophileh...@lycos.com
wrote:
[...]
In my opinion the std.bitmanip.bitfields souce code is already past the
decency limit for string mixins, and I hope they will be replaced
== Quote from ABothe (i...@alexanderbothe.com)'s article
Hi everyone,
I don't know if it's a bug or not .. but D or at least its GC doesn't want to
free my allocated stuff! Also when I 'disable' the GC via GC.disable(); it
won't free it :-/
byte[] asdf=new byte[50_000_000]; // OK a bit
On 07/12/2010 06:21 PM, Nick Sabalausky wrote:
Steven Schveighofferschvei...@yahoo.com wrote in message
news:op.vfq0aydoeav...@localhost.localdomain...
On Mon, 12 Jul 2010 16:22:28 -0400, bearophilebearophileh...@lycos.com
wrote:
Steven Schveighoffer:
bearophile:
String mixins are a hack,
ABothe, el 12 de julio a las 23:44 me escribiste:
Hi everyone,
I don't know if it's a bug or not .. but D or at least its GC doesn't want to
free my allocated stuff! Also when I 'disable' the GC via GC.disable(); it
won't free it :-/
Disable that exactly that, force the GC *not* to run a
Andrei Alexandrescu seewebsiteforem...@erdani.org wrote in message
news:i1ge6c$c9...@digitalmars.com...
On 07/12/2010 06:21 PM, Nick Sabalausky wrote:
Steven Schveighofferschvei...@yahoo.com wrote in message
Brainfuck is basically a toy example of a language. Nobody uses it for
serious
On 07/12/2010 12:42 PM, Andrei Alexandrescu wrote:
Would this be an improvement?
Yes. I approve enough to come out of lurking. (Though I do agree with
Nick on DoubleEndedRange)
- Brian
On 07/12/2010 04:39 PM, Steven Schveighoffer wrote:
On Mon, 12 Jul 2010 17:25:43 -0400, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
On 07/12/2010 02:41 PM, Steven Schveighoffer wrote:
I'm unsure how it will work either. I admit now that I didn't think
through how this will be
On Monday 12 July 2010 20:48:05 Andrei Alexandrescu wrote:
I think I figured out a comfortable and all-encompassing means to define
a simplified interface for an input range.
Currently input ranges need to define empty, front, and popFront. That
works but it's a bit heavy for simple input
On 07/12/2010 11:21 PM, Jonathan M Davis wrote:
On Monday 12 July 2010 20:48:05 Andrei Alexandrescu wrote:
I think I figured out a comfortable and all-encompassing means to define
a simplified interface for an input range.
Currently input ranges need to define empty, front, and popFront. That
Andrei Alexandrescu Wrote:
getNext is easy to define for e.g. arrays and files. How does it sound?
Does it bring significant simplification?
Andrei
I'm with Jonathan on this. I don't really see much of a benefit. popFront,
empty, front are very easy to define and simple to use.
Java
On 7/12/2010 19:41, Nick Sabalausky wrote:
I already agreed to that part (For writing, yes...). But there are other
uses that *do* parse, and others that do both. The point is NOT that string
mixins are *always* unsatisfactory as a replacement for AST macros. The
point is that *there are
On 07/12/2010 10:48 PM, Andrei Alexandrescu wrote:
I think I figured out a comfortable and all-encompassing means to define
a simplified interface for an input range.
Currently input ranges need to define empty, front, and popFront. That
works but it's a bit heavy for simple input ranges. We've
On Tue, Jul 13, 2010 at 05:18, Andrei Alexandrescu
seewebsiteforem...@erdani.org wrote:
To clarify:
http://erdani.com/d/phobos/std_range.html
Seems good to me. Lots of flexibility. I may begin to write output ranges
:-)
So in the very first case, e may well be a range, but the way
On 11.07.2010 20:30, Jacob Carlborg wrote:
On 2010-07-11 19.09, torhu wrote:
On 22.06.2010 14:49, Jacob Carlborg wrote:
On 2010-06-22 01:40, torhu wrote:
[...]
I've set up my own project on Bitbucket. I've made enough changes to
build my DWT app on Windows, and it's works like a charm. A
Okay. There are cases where you want a constructor to do something when the
class/struct is created, and you want the destructor to do something when the
class/struct goes out of scope. A classic example would be an autolock for a
mutex. Another would be the hourglass in MFC - it's displayed
On Sun, 11 Jul 2010 23:25:32 -0700, Jonathan M Davis wrote:
Okay. There are cases where you want a constructor to do something when
the class/struct is created, and you want the destructor to do something
when the class/struct goes out of scope. A classic example would be an
autolock for a
On Mon, 12 Jul 2010 08:25:32 +0200, Jonathan M Davis
jmdavisp...@gmail.com wrote:
Okay. There are cases where you want a constructor to do something when
the
class/struct is created, and you want the destructor to do something
when the
class/struct goes out of scope. A classic example
On Monday 12 July 2010 00:27:11 Rory McGuire wrote:
Do you know about the scope storage class, or about scope classes?
{
scope tmp = new A();
// use tmp;
tmp destructor is called.
}
scope classes are similar:
http://www.digitalmars.com/d/2.0/class.html
Except
On Mon, 12 Jul 2010 00:03:53 +0200, BLS windev...@hotmail.de wrote:
On 11/07/2010 21:29, Philippe Sigaud wrote:
I tried this because I was reading an article on Scala's actors, where
they talk about millions of actors. I guess they are quite different.
Google for fibers or have a look at
On Sunday 11 July 2010 23:41:21 Lars T. Kyllingstad wrote:
That said, the recommended best practice for D is, if possible, to use
scope guards:
void doStuffWith(string resourceName)
{
auto resource = acquire(resourceName);
scope(exit) release(resource);
... // Do
On 2010-07-12 08.25, Jonathan M Davis wrote:
Okay. There are cases where you want a constructor to do something when the
class/struct is created, and you want the destructor to do something when the
class/struct goes out of scope. A classic example would be an autolock for a
mutex. Another would
hi,
can anybody tell me please why the linker keeps bringing up this error
message? i am using the latest dmd 2.
thank you
OPTLINK (R) for Win32 Release 8.00.2
Copyright (C) Digital Mars 1989-2009 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
obj\Debug\SServer.obj(SServer)
On 12/07/2010 10:35, Justin Spahr-Summers wrote:
On Mon, 12 Jul 2010 00:03:53 +0200, BLSwindev...@hotmail.de wrote:
On 11/07/2010 21:29, Philippe Sigaud wrote:
I tried this because I was reading an article on Scala's actors, where
they talk about millions of actors. I guess they are quite
On 12/07/2010 14:18, Lars T. Kyllingstad wrote:
I'm pretty sure they will be soon, perhaps even in the next release:
http://www.dsource.org/projects/druntime/changeset/321
-Lars
Thanks Lars.. Good news ! Hope the auto x = whatever(); // thing for
ddoc is also solved than..
j Wrote:
hi,
can anybody tell me please why the linker keeps bringing up this error
message? i am using the latest dmd 2.
thank you
OPTLINK (R) for Win32 Release 8.00.2
Copyright (C) Digital Mars 1989-2009 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
Hello j,
hi,
can anybody tell me please why the linker keeps bringing up this error
message? i am using the latest dmd 2.
thank you
OPTLINK (R) for Win32 Release 8.00.2
Copyright (C) Digital Mars 1989-2009 All rights reserved.
http://www.digitalmars.com/ctg/optlink.html
On 12/07/2010 02:50, sybrandy wrote:
The rule of thumb is don't bother spawning more threads than you
have cpus. You're just wasting resources mostly.
You REALLY don't want more threads trying to run than you have cores.
Threads in a wait state, are less of an issue, but they still use up
This had me crazy. I ended up putting the brackets on the variable, like
int marr[3][5];
then it worked like
marr[2][4] = 9;
Jonathan M Davis jmdavisp...@gmail.com wrote:
Except that that's two statements and it's no longer RAII. The beauty of
doing
it entirely in the constructor and destructor is that you only need one
statement and the whole thing takes care of itself. With scope, you have
to
worry about
Heywood Floyd:
This had me crazy. I ended up putting the brackets on the variable, like
int marr[3][5];
then it worked like
marr[2][4] = 9;
That's present only for compatibility with C syntax, this means that you can
use it to perform a quicker port of C code to D, but you are supposed
On 12.07.2010 08:25, Jonathan M Davis wrote:
Okay. There are cases where you want a constructor to do something when the
class/struct is created, and you want the destructor to do something when the
class/struct goes out of scope. A classic example would be an autolock for a
mutex. Another would
bearophile Wrote:
Heywood Floyd:
This had me crazy. I ended up putting the brackets on the variable, like
int marr[3][5];
then it worked like
marr[2][4] = 9;
That's present only for compatibility with C syntax, this means that you can
use it to perform a quicker port of C code
1 - 100 of 110 matches
Mail list logo