Hello,
I am trying to use the std.log module that is here:
https://github.com/linkrope/log.d
And I encountered a segmentation fault using dmd 2.065 on a Linux
64 platform. The reduced test case is this:
//
import
In the following snippet is the line marked WOAH legal? The
compiler doesn't complain about the trailing comma in the
constructor arguments.
import std.stdio;
class Foo
{
public this(string foo)
{
}
}
void main(string[] args)
{
auto foo = new Foo(bar, ); // --
On Sunday, 4 May 2014 at 10:04:26 UTC, Gary Willoughby wrote:
In the following snippet is the line marked WOAH legal? The
compiler doesn't complain about the trailing comma in the
constructor arguments.
import std.stdio;
class Foo
{
public this(string foo)
{
}
}
void
On 5/4/2014 6:42 PM, Alex wrote:
Hello,
I am trying to use the std.log module that is here:
https://github.com/linkrope/log.d
And I encountered a segmentation fault using dmd 2.065 on a Linux 64
platform. The reduced test case is this:
On Sunday, 4 May 2014 at 09:42:17 UTC, Alex wrote:
Hello,
I am trying to use the std.log module that is here:
https://github.com/linkrope/log.d
And I encountered a segmentation fault using dmd 2.065 on a
Linux 64 platform. The reduced test case is this:
On Sunday, 4 May 2014 at 10:28:30 UTC, Mike Parker wrote:
The current implementation of the GC will run destructors on
any objects still resident on the heap during termination.
There is no way to guarantee the order in which those
destructors will be run.
Most likely, what you're seeing is
monarch_dodra:
As rule of thumb, you can't allocate during a GC cleaning
cycles, and class destructors are usually called during a GC
cleaning cycle.
This means it is usually unsafe to call *anything* that could
potentially allocate in a destructor.
So it could be a good idea to have
On Friday, 2 May 2014 at 21:29:51 UTC, Mark Isaacson wrote:
Auto ref parameters seem to be just what I need. Thanks! I'd
still be curious if anyone has additional information regarding
the rationale at play (I'm spoiled, reading TDPL and having
each decision explained in text).
I had the
On 05/04/2014 12:58 PM, Marc Schütz schue...@gmx.net wrote:
This means that you will still get a (bit-wise) copy if you pass in an
r-value. But semantically, this is a move, not a copy, so it is
potentially cheaper than a copy (if your type has an expensive postblit).
It can be constructed
On Sunday, 4 May 2014 at 11:15:59 UTC, Timon Gehr wrote:
On 05/04/2014 12:58 PM, Marc Schütz schue...@gmx.net wrote:
This means that you will still get a (bit-wise) copy if you
pass in an
r-value. But semantically, this is a move, not a copy, so it is
potentially cheaper than a copy (if your
On Fri, 02 May 2014 08:17:06 +
Mark Isaacson via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
I'm in the process of learning/practicing D and I noticed
something that seems peculiar coming from a C++ background:
If I compile and run:
void fun(const ref int x) {
Jonathan M Davis:
Andrei suggested auto ref to fix this problem, and Walter
implemented it, but he misunderstood what Andrei had meant,
I missed this detail of the story :-)
Walter has suggested that we just redefine ref itself to do
what I just
described rather than using auto ref or
I would now like to define rules for assignments and implicit
conversions with the following checks
I believe I found a good solution through struct wrappers. See
update at:
https://github.com/nordlow/justd/blob/master/enums.d
I'm trying to improve
https://github.com/nordlow/justd/blob/master/enums.d
through use of template mixins
http://dlang.org/template-mixin.html
to improve EnumUnion as follows:
struct EnumUnion(E...)
{
alias OriginalType = CommonOriginalType!E;
alias U = UnionEnum!(E);// Wrapped
Am 03.05.2014 21:47, schrieb Timon Gehr via Digitalmars-d-learn:
On 05/03/2014 08:20 PM, Tim Holzschuh via Digitalmars-d-learn wrote:
Let me know if you also want hints on how to get the logic right.
Would be very nice!
While 2*2 works, 2+2 throws an Error because the number-method gets an
On 5/4/2014 7:39 PM, monarch_dodra wrote:
Really??? I knew there was no guarantee in which order the destructor
were run, but at the very least, I thought you had a guarantee of
dependency ordering?
Furthermore, the order in which the garbage collector calls destructors
for unreference
I am trying to compile next code:
import std.net.curl;
import std.stdio;
void main()
{
writeln(get(https://google.com/;));
}
and got next error
http://www.everfall.com/paste/id.php?y37dr6qmu54h
Is there a good way to connect signals and slots when the objects are
far apart? All tutorials for signals and slots show the objects being
readily accessible by the main() function. But what if they're not? Is
there an elegant design?
For example, here's a typical minimal demo:
On Friday, 2 May 2014 at 15:25:55 UTC, Nordlöw wrote:
On Friday, 2 May 2014 at 10:42:40 UTC, yazd wrote:
On Thursday, 1 May 2014 at 17:31:52 UTC, Nordlöw wrote:
Here you go, https://github.com/yazd/elf-d.
Thanks!
Anytime. By the way, if you need more stuff out of it or help,
post an issue
On Sunday, 4 May 2014 at 18:11:45 UTC, yazd wrote:
On Friday, 2 May 2014 at 15:25:55 UTC, Nordlöw wrote:
On Friday, 2 May 2014 at 10:42:40 UTC, yazd wrote:
On Thursday, 1 May 2014 at 17:31:52 UTC, Nordlöw wrote:
Here you go, https://github.com/yazd/elf-d.
Thanks!
Anytime. By the way, if
Thanks for the insights! I suppose we'll get a chance to see
where things stand at this year's dconf.
It's quite interesting that D's concept of r-values seems less
developed than C++. Here's hoping that that only results in a
better thought out solution.
On Sunday, 4 May 2014 at 10:28:30 UTC, Mike Parker wrote:
On 5/4/2014 6:42 PM, Alex wrote:
Hello,
I am trying to use the std.log module that is here:
https://github.com/linkrope/log.d
And I encountered a segmentation fault using dmd 2.065 on a
Linux 64
platform. The reduced test case is
Alex:
Why the compiler does not complain or,
I've just asked something related to this in the main D
newsgroup, take a look there for answers. Today D has means to
complain statically.
But I don't know the fate of D class destructors.
Bye,
bearophile
What is wrong?
For some reason the mixin declarations for op* are not imported
into the calling scope when others are.
Compiler bug?
I'm looking for a means to associate a key with a value and
iterate over said container in-order. My natural choice in C++
would be std::map. When I look in std.container, I see that there
is a RedBlackTree implementation, however this does not associate
a key with a value (it is the
Mark Isaacson:
2) Create a wrapper struct that contains key and value and
whose comparison operator is defined only on the key. This
would essentially be doing what the C++ implementation does.
Until we have a tree-based associative map, use a tuple for the
key-value and define a less
On Sunday, 4 May 2014 at 21:40:04 UTC, bearophile wrote:
Mark Isaacson:
2) Create a wrapper struct that contains key and value and
whose comparison operator is defined only on the key. This
would essentially be doing what the C++ implementation does.
Until we have a tree-based associative
Mark Isaacson:
Got it, no native support. Most unfortunate.
What native support are you talking about?
I've always been vehemently against losing self-documentation
via the std::pair/tuple based solution to the problem.
What self documentation are you losing in D?
I ended up rolling my
On Sunday, 4 May 2014 at 21:40:04 UTC, bearophile wrote:
Mark Isaacson:
2) Create a wrapper struct that contains key and value and
whose comparison operator is defined only on the key. This
would essentially be doing what the C++ implementation does.
Until we have a tree-based associative
On Sunday, 4 May 2014 at 22:25:36 UTC, bearophile wrote:
Dicebot:
What benefits this gives over definining distinct struct?
Sounds like unnecessary complication for me.
See the code in my precedent post, what do you think about it?
Bye,
bearophile
Change
alias Two =
Dicebot:
What benefits this gives over definining distinct struct?
Sounds like unnecessary complication for me.
See the code in my precedent post, what do you think about it?
Bye,
bearophile
On 05/04/2014 04:56 PM, Tim Holzschuh via Digitalmars-d-learn wrote:
Am 03.05.2014 21:47, schrieb Timon Gehr via Digitalmars-d-learn:
On 05/03/2014 08:20 PM, Tim Holzschuh via Digitalmars-d-learn wrote:
Let me know if you also want hints on how to get the logic right.
Would be very nice!
Interesting. I clearly have more to learn about Tuple. I think I
concur with Dicebot's alterations for self-documentation.
Thanks for all of your suggestions gentlemen.
On 5/4/14, 6:04 PM, Mark Isaacson wrote:
I'm looking for a means to associate a key with a value and iterate over
said container in-order. My natural choice in C++ would be std::map.
When I look in std.container, I see that there is a RedBlackTree
implementation, however this does not associate
On Sun, 04 May 2014 19:08:27 +
Mark Isaacson via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
Thanks for the insights! I suppose we'll get a chance to see
where things stand at this year's dconf.
It's quite interesting that D's concept of r-values seems less
developed
You could replace all those `op=='+'||op=='-'? ...` with
`op.among!('+', '-')? ...`.
Guys, could someone help me with suitable template?
I have C macro, which calculates the offset of the field in a
struct:
#define offsetof(type, field) ((long) ((type *)0)-field)
A similar D code is, as far as I know,
type.field.offsetof
Is there an any way to make a corresponding D
On Monday, 5 May 2014 at 03:57:54 UTC, Andrey wrote:
Guys, could someone help me with suitable template?
I have C macro, which calculates the offset of the field in a
struct:
#define offsetof(type, field) ((long) ((type *)0)-field)
A similar D code is, as far as I know,
38 matches
Mail list logo