On Monday, 14 November 2016 at 17:43:37 UTC, WhatMeWorry wrote:
I was reading this fasciniating article:
https://davesdprogramming.wordpress.com/2013/05/06/low-lock-singletons/
And to quote a section of it:
-
static MySingleton get() {
sy
On Monday, 31 October 2016 at 17:04:28 UTC, Temtaime wrote:
On Monday, 31 October 2016 at 16:55:51 UTC, WhatMeWorry wrote:
Is there a way to turn off nothrow or work around it? Because
to me it looks like nothrow prevents me from doing anything
useful.
extern(C) void onKeyEvent(GLFWwindow*
On Sunday, 25 September 2016 at 16:23:11 UTC, Matthias Klumpp
wrote:
Hello!
I am working together with others on the D-based
appstream-generator[1] project, which is generating software
metadata for "software centers" and other package-manager
functionality on Linux distributions, and is used
On Sunday, 25 September 2016 at 16:07:12 UTC, Matthias Klumpp
wrote:
Hello!
I have a class similar to this one:
```
class Dummy
{
private:
string tmpDir;
public:
this (string fname)
{
tmpDir = buildPath ("/tmp", fname.baseName);
std.file.mkdirRecurse (tmpDir);
On Monday, 22 February 2016 at 07:10:23 UTC, Kapps wrote:
If you do want to test the differences between the range
approach and the loop approach, something like:
auto sumtest4(Range)(Range range) @safe pure {
return range.reduce!((a, b) => a + b);
}
is a more fair comparison. I get resu
If you do want to test the differences between the range approach
and the loop approach, something like:
auto sumtest4(Range)(Range range) @safe pure {
return range.reduce!((a, b) => a + b);
}
is a more fair comparison. I get results within 15% of sumtest2
with this using dmd. I think wi
On Saturday, 13 February 2016 at 00:41:35 UTC, tsbockman wrote:
On Friday, 12 February 2016 at 23:46:09 UTC, Kapps wrote:
You'll encounter this pretty often in Phobos I think. I really
don't think @nogc is ready, and tend to avoid it in my code.
Exceptions are a big reason for it, and lots of f
On Thursday, 11 February 2016 at 12:41:16 UTC, rcorre wrote:
On Thursday, 11 February 2016 at 04:20:13 UTC, tsbockman wrote:
On Thursday, 11 February 2016 at 03:09:51 UTC, rcorre wrote:
I recently tried compiling enumap with GDC, and found that it
disagrees with DMD on whether a function is @no
On Tuesday, 26 January 2016 at 04:31:07 UTC, Igor wrote:
On Tuesday, 26 January 2016 at 03:06:40 UTC, maik klein wrote:
On Tuesday, 26 January 2016 at 03:03:40 UTC, Igor wrote:
Is there a GC-less array that we can use out of the box or do
I have to create my own?
https://dlang.org/phobos/std_
On Friday, 15 January 2016 at 20:04:47 UTC, Nordlöw wrote:
On Friday, 15 January 2016 at 16:51:24 UTC, Anon wrote:
On Friday, 15 January 2016 at 14:04:50 UTC, Nordlöw wrote:
What have I missed?
In line 126, `static struct Result()` is a template. Either
drop the parens there, or change the c
On Monday, 4 January 2016 at 09:13:25 UTC, Jonathan M Davis wrote:
On Monday, January 04, 2016 07:30:50 aki via
Digitalmars-d-learn wrote:
But wait, how does GC detect there still be a live reference to
the object Foo?
Because store is just a fix sized array of bytes.
ubyte[size] store;
GC canno
On Monday, 14 September 2015 at 18:31:38 UTC, H. S. Teoh wrote:
I decided to give the code a spin with `gdc -O3 -pg`. Turns out
that the hotspot is in std.array.split, contrary to
expectations. :-) Here are the first few lines of the gprof
output:
[...]
Perhaps using the new rangified spli
On Saturday, 22 August 2015 at 19:14:16 UTC, nims wrote:
I think interfaces are very powerful and I heavily use them.
The only problem I have with them is that
serializing/deserializing them to XML or JSON doesn't seem to
work. So far I got to try Orange and painlessjson. Using Orange
all I go
On Wednesday, 29 July 2015 at 17:09:52 UTC, Namespace wrote:
On Wednesday, 29 July 2015 at 09:25:50 UTC, Snape wrote:
I'm in the early stages of building a little game with OpenGL
(in D) and I just want to know the facts about the GC before I
decide to either use it or work around it. Lots of p
On Wednesday, 1 July 2015 at 09:09:53 UTC, aki wrote:
Following code causes run-time error.
How can I use static this() without causing error?
It's difficult to avoid this situation because
actual code is more complex.
file main.d:
void main() {
}
file a.d:
import b;
class A {
static th
On Tuesday, 2 June 2015 at 07:18:33 UTC, Robert M. Münch wrote:
On 2015-06-01 17:29:08 +, Steven Schveighoffer said:
No, you must explicitly intialize. Classes are ALL reference
types in D, no in-situ placement of classes
Ok, thanks. Still to much C++ logic in my head ;-) I'm getting
rid
On Monday, 1 June 2015 at 16:52:30 UTC, Robert M. Münch wrote:
I'm a bit confused... I have the following class:
class foo : superFoo {
aFoo spec;
aFoo lvars;
aFoo bdy;
override string toString(){
if(spec.isEmpty() && lvars.isEmpty()){
return "does spec";
}
if(lvars.isEmpty()){
On Monday, 2 March 2015 at 12:37:33 UTC, drug wrote:
I guess the reason why std.conv.emplace is not @nogc-ed is that
nobody added it yet? I didn't see using of gc in the emplace
sources.
Soon:
https://github.com/D-Programming-Language/phobos/pull/2999
On Thursday, 11 December 2014 at 20:11:21 UTC, Andrew Klaassen
wrote:
The docs for stdio.lines say that it's a struct. stdio.lines
works with foreach.
The docs for foreach say:
"Iteration over struct and class objects can be done with
ranges. For foreach, this means the following properties
On Friday, 5 December 2014 at 20:38:31 UTC, Gary Willoughby wrote:
How can i check that a type is a struct at compile time? I know
i can test for a class like this:
static if(is(T == class))
{
...
}
But how to do the same thing for a struct?
Same thing but with struct: is(T == struct)
N
On Thursday, 27 November 2014 at 09:33:49 UTC, Chris wrote:
[Maybe this has been asked before.]
I usually use dub to create and build projects. I built one of
the projects with dub and then by hand with dmd[1] passing all
the files etc. Turned out that the executable built with dub
was 1.4 MB
On Friday, 14 November 2014 at 23:29:34 UTC, Satoshi wrote:
Hi, Im using GDC 4.9.0 compiler. I have template classes like
"public class LinkedList(T) {...}" and when I try compile it
together, everything works fine. But when I compile every
source file to separate object file and link it togeth
On Friday, 24 October 2014 at 18:38:39 UTC, tcak wrote:
On Friday, 24 October 2014 at 16:51:02 UTC, Kapps wrote:
On Friday, 24 October 2014 at 10:49:42 UTC, tcak wrote:
Not sure if this is the same issue, but by default gdb breaks
on signals that the GC uses, which would explain why it's
brea
On Friday, 24 October 2014 at 10:49:42 UTC, tcak wrote:
On Friday, 24 October 2014 at 10:46:57 UTC, tcak wrote:
On Friday, 24 October 2014 at 10:29:10 UTC, Kagamin wrote:
Looks like your IDE filters too much. Can you configure it to
filter less and show address locations?
This is what I have
On Tuesday, 21 October 2014 at 09:14:08 UTC, ketmar via
Digitalmars-d-learn wrote:
On Tue, 21 Oct 2014 09:01:32 +
Kapps via Digitalmars-d-learn
wrote:
no template magic
that's very bad. it's time to stop making people think that
templates
are inevitably arcane.
I like D
On Thursday, 16 October 2014 at 22:26:51 UTC, RBfromME wrote:
I'm a newbie to programming and have been looking into the D
lang as a general purposing language to learn, yet the D
overview indicates that java would be a better language to
learn for your first programming language. Why? Looks l
Derelict provides bindings to C libraries, and loads them at
runtime. So glfw3.dll is actually an existing C library (you can
get it at http://www.glfw.org/download.html), which Derelict
provides bindings for. Derelict / your code does not generate the
actual dll.
On Monday, 4 August 2014 at 05:14:22 UTC, Philippe Sigaud via
Digitalmars-d-learn wrote:
I have another question: it seems I can spawn hundreds of
threads
(Heck, even 10_000 is accepted), even when I have 4-8 cores. Is
there:
is there a limit to the number of threads? I tried a threadpool
bec
On Sunday, 3 August 2014 at 03:39:25 UTC, Rikki Cattermole wrote:
Lastly the game dev industry is very hesitant to change
languages for a lot of reasons. And one of those is platform
support. They won't be seeing D on e.g. Xbox One anytime soon
if you get my drift.
Apparently D already work
On Wednesday, 9 July 2014 at 13:18:00 UTC, Larry wrote:
You are definitely right, I did mess up while translating !
I run the corrected codes (the ones I was meant to provide :S)
and on a slow macbook I end up with :
C : 2
D : 15994
Of course when run on very high end machines, this diff is
Measure a larger number of loops. I understand you're concerned
about microseconds, but your benchmark shows nothing because your
timer is simply not accurate enough for this. The benchmark that
bearophile showed where C took ~2 nanoseconds vs the ~7000 D took
heavily implies to me that the C i
Possibly something related to:
https://github.com/D-Programming-Language/dmd/pull/3715
Have you tried updating to git master today?
On Thursday, 26 June 2014 at 17:07:30 UTC, JJDuck wrote:
On Thursday, 26 June 2014 at 16:33:57 UTC, JJDuck wrote:
I tried to use phobos , but there is no such function exists
for posting to https too
With Phobos, you can use
http://dlang.org/phobos/std_net_curl.html#post. Depending on t
A bit late, but you should also be able to do:
import scriptlike;
alias Config = std.process.Config;
On Wednesday, 18 June 2014 at 15:03:55 UTC, Ali Çehreli wrote:
On 06/18/2014 06:28 AM, Chris wrote:
On Wednesday, 18 June 2014 at 11:57:06 UTC, Chris wrote:
Windows: in a D-DLL I'm trying to spawn a thread. However,
nothing
happens
auto myThread = spawn(&myFunction, thisTid);
send(myThread, a
Possibly https://issues.dlang.org/show_bug.cgi?id=11763 or
https://issues.dlang.org/show_bug.cgi?id=11903
On Saturday, 14 June 2014 at 01:24:05 UTC, Mike Franklin wrote:
In other words, is 'shared __gshared' redundant?
All __gshared does is makes the variable not go into thread-local
storage, nothing more. Shared does this, as well as modify the
type to be shared(T) instead of just T. So yes, it'
On Wednesday, 11 June 2014 at 20:59:25 UTC, Nordlöw wrote:
Can somebody explain the meaning of split in the error message
Deprecation: function core.time.Duration.weeks is deprecated -
Please use split instead. weeks was too frequently confused for
total!"weeks".
given by function
shortDura
On Tuesday, 10 June 2014 at 20:58:41 UTC, Nordlöw wrote:
Is there a way to, programatically (trait), lookup the source
file and position of a user defined type either dynamically or,
even better, statically?
I don't believe this is possible. Perhaps you would be able to
generate the .json file
On Wednesday, 11 June 2014 at 02:30:01 UTC, WhatMeWorry wrote:
In Mr. Cehreli's book it says
Additionally, the length of dynamic arrays can be changed by
assigning a value to this property:
int[] array; // initially empty
array.length = 5; // now has 5 elements
while in Mr. Alexandrescu's bo
On Tuesday, 10 June 2014 at 20:01:37 UTC, Nordlöw wrote:
Notice that A.init.tupleof segfaults for classes so that is
_not_ an adviced solution in a generic solution!
There's no need to use .init:
import std.stdio;
struct Foo {
int a, b;
}
void main() {
writeln(__traits(id
On Tuesday, 10 June 2014 at 16:13:31 UTC, Adam D. Ruppe wrote:
Two options: do allMembers and filter it out to only be data
members, or do some slicing of tupleof.stringof:
S s;
foreach(idx, member; s.tupleof) {
writeln("Name: ", s.tupleof[idx].stringof[2..$]);
}
The tupleof[idx] inside th
On Friday, 16 May 2014 at 01:07:28 UTC, Kapps wrote:
On Friday, 16 May 2014 at 00:23:00 UTC, Jack wrote:
I recently downloaded Xamarin Studio from the Mono-Develop
site(as this was the only available installer on that site)
and was looking to try out Mono-D.
Then this showed up: http://puu.sh
On Friday, 16 May 2014 at 00:23:00 UTC, Jack wrote:
I recently downloaded Xamarin Studio from the Mono-Develop
site(as this was the only available installer on that site) and
was looking to try out Mono-D.
Then this showed up: http://puu.sh/8NV4V.png
Was wondering where I can get those depend
On Wednesday, 14 May 2014 at 23:50:34 UTC, Meta wrote:
On the topic of lazy, why *is* it so slow, exactly? I thought
it was just shorthand for taking a function that evaluates the
expression, and wrapping said expression in that function at
the call site. That is, I thought that:
int doSometh
On Wednesday, 14 May 2014 at 17:20:37 UTC, David Nadlinger wrote:
On Wednesday, 14 May 2014 at 15:42:13 UTC, Damian Day wrote:
On Wednesday, 14 May 2014 at 14:54:57 UTC, David Nadlinger
wrote:
Could you post a short benchmark snippet explicitly showing
the problem?
Benchmark found here:
htt
On Monday, 12 May 2014 at 15:02:54 UTC, Moses wrote:
PATH environment variable is not related at all with phobos2
sources paths.
All Linux packages (Ubuntu too) includes
"-I/usr/include/dmd/phobos" on /etc/dmd.conf configuration
file.
If you need to explicit pass this argument to dmd compiler
On Tuesday, 6 May 2014 at 15:56:11 UTC, Kapps wrote:
On Monday, 5 May 2014 at 22:11:39 UTC, Ali Çehreli wrote:
On 05/05/2014 02:38 PM, Kapps wrote:
> I think that the GC actually blocks when
> creating objects, and thus multiple threads creating
instances would not
> provide a significant speed
On Monday, 5 May 2014 at 22:11:39 UTC, Ali Çehreli wrote:
On 05/05/2014 02:38 PM, Kapps wrote:
> I think that the GC actually blocks when
> creating objects, and thus multiple threads creating
instances would not
> provide a significant speedup, possibly even a slowdown.
Wow! That is the case.
On Monday, 5 May 2014 at 17:14:54 UTC, Caslav Sabani wrote:
Hi,
I have just started to learn D. Its a great language. I am
trying to achieve the following but I am not sure is it
possible or should be done at all:
I want to have one array where I will store like 10
objects.
But I wa
50 matches
Mail list logo