On Thursday, 21 April 2016 at 22:59:58 UTC, Alex wrote:
Ok... I make slices of them, carefully avoiding to make
copies...
Yeah, that shouldn't make a difference..
Huh? I think, this is the place, where I lack some
background... So, I bind my delegates via
Can you post any more of your
On Thursday, 21 April 2016 at 23:05:38 UTC, deed wrote:
Often I find myself wanting to alias an expression, such as
verbose fields, possibly nested. AFAIK, the with statement
makes it easier, but not as good as it could have been. What
I'd like to express is for example something like this:
Often I find myself wanting to alias an expression, such as
verbose fields, possibly nested. AFAIK, the with statement makes
it easier, but not as good as it could have been. What I'd like
to express is for example something like this:
with( a = instanceA.verboseFieldA.verboseFieldB,
b
On Thursday, 21 April 2016 at 19:54:10 UTC, via
Digitalmars-d-learn wrote:
I'm on mobile so I will be brief now and expand later
On Thu, Apr 21, 2016 at 07:37:59PM +, QAston via
Digitalmars-d-learn wrote:
Just like classes - when closure expression is executed.
Heap closures are
On Thursday, 21 April 2016 at 19:37:59 UTC, QAston wrote:
On Thursday, 21 April 2016 at 17:27:09 UTC, Alex wrote:
Ok. So, does this mean, that they just allocate on
creation/binding them? If so, there is no problem and there
are no questions any more.
Just like classes - when closure
On 04/21/2016 02:15 PM, Steven Schveighoffer wrote:
> I was unaware that a spawned thread
> terminating via uncaught exception does nothing.
>
> It kind of makes sense, but definitely not what many would expect.
In case it's useful to others, there is something written about it here:
On 4/21/16 1:29 PM, Steven Schveighoffer wrote:
I get strange behavior. Not an error/exception, but basically hung
process. I tried modifying different things, and passing other types of
messages. Seems almost like the call to send is ignored for sending the
s message.
Nevermind, this is my
I'm on mobile so I will be brief now and expand later
On Thu, Apr 21, 2016 at 07:37:59PM +, QAston via Digitalmars-d-learn wrote:
> Just like classes - when closure expression is executed.
Heap closures are actually allocated on declaration. The compiler
looks to see if it will need to be
On Thursday, 21 April 2016 at 12:35:42 UTC, Anonymouse wrote:
Then dmd -unittest -version=TestDeps if you want them run.
This doesn't make things easier. I want to disable the builtin
unittests of the modules I've imported. This requires me to add a
version(test_MODULE) unittest
in each
On Thursday, 21 April 2016 at 17:27:09 UTC, Alex wrote:
Ok. So, does this mean, that they just allocate on
creation/binding them? If so, there is no problem and there are
no questions any more.
Just like classes - when closure expression is executed.
I have an unusual caption... On creation
Am Thu, 21 Apr 2016 00:14:53 +
schrieb Straivers :
> Hi,
>
> I want to make a utility wrapper around a core.simd.float4, and
> have been trying to make the following code work, but have been
> met with no success.
>
> auto add(float rhs)
> {
> return
On 4/21/16 1:33 PM, ag0aep6g wrote:
This creates a `shared(S!(M, 2))*`, which is not exactly the same as
`shared(S!(M, 2)*)`. The pointer is not shared in the former, but it is
shared in the latter.
I was going to suggest either sending a `shared(TS*)` or receiving a
`shared(T)*`. But it looks
On Thursday, 21 April 2016 at 17:33:32 UTC, ag0aep6g wrote:
On 21.04.2016 19:10, jacob wrote:
I was going to suggest either sending a `shared(TS*)` or
receiving a `shared(T)*`. But it looks like you can't send a
shared pointer. When I tried, it got turned into a
unshared-pointer-to-shared on
On 21.04.2016 19:10, jacob wrote:
private void runner(T)()
{
shared(T*) s = receiveOnly!(shared(T*))();
This tries to receive a `shared(S!(M, 2)*)`.
writeln(s.x.length);
writeln(s.x[0]);
send(thisTid, true);
Aside: Should be `ownerTid` here, no?
}
int main(string[]
On 4/21/16 1:10 PM, jacob wrote:
import std.stdio;
import std.concurrency;
shared struct S(T, uint M)
{
T[M] x;
}
shared struct M
{
int x;
}
private void runner(T)()
{
shared(T*) s = receiveOnly!(shared(T*))();
writeln(s.x.length);
writeln(s.x[0]);
send(thisTid,
On Thursday, 21 April 2016 at 15:44:56 UTC, QAston wrote:
Closure (delegate type) objects have to allocate because
they're reference types and have state. For stateful reference
types to be safe they have to be put on the GC allocated heap.
Ok. So, does this mean, that they just allocate on
Hello!
I try to send shared pointer to struct:
[code]
import std.stdio;
import std.concurrency;
shared struct S(T, uint M)
{
T[M] x;
}
shared struct M
{
int x;
}
private void runner(T)()
{
shared(T*) s = receiveOnly!(shared(T*))();
writeln(s.x.length);
On 4/21/16 10:47 AM, Nick Treleaven wrote:
Hi,
There doesn't seem to be something like this in Phobos:
alias Instantiate(alias Template, T...) = Template!T;
Here's an example of why I need it:
alias staticEx(string msg, string file = __FILE__, size_t line =
__LINE__) =
On Thursday, 21 April 2016 at 12:57:36 UTC, Rene Zwanenburg wrote:
On Thursday, 21 April 2016 at 11:54:27 UTC, rcorre wrote:
Thanks for the tip. Here's the linking code it shows:
cc d.o -o d -m64 -L/usr/lib -L/usr/lib32 -Xlinker
--export-dynamic -Xlinker -Bstatic -lphobos2 -Xlinker
On Wednesday, 20 April 2016 at 20:07:31 UTC, Nordlöw wrote:
On Wednesday, 20 April 2016 at 16:08:32 UTC, Lass Safin wrote:
core.memory.GC.setAttr can set attributes for a block of
memory, with which you can set the attribute NO_SCAN, which as
it implies, forces that no scan be done in the
On Saturday, 16 April 2016 at 04:04:24 UTC, Justice wrote:
Is it difficult to create a D business like app and connect it
to android through java for the interface?
I'd rather create all the complex stuff in D and either use it
natively through java(I need a UI).
If it is workable, can the
On Thursday, 21 April 2016 at 15:22:15 UTC, Alex wrote:
Hi all!
timing my program with valgrind/cachegrind and using -vgc
option of the compiler found the message:
"using closure causes GC allocation"
The question is:
does the usage of the closure causes the GC allocation on every
usage of
Hi all!
timing my program with valgrind/cachegrind and using -vgc option
of the compiler found the message:
"using closure causes GC allocation"
The question is:
does the usage of the closure causes the GC allocation on every
usage of the closure or only on creation/assigning of it? If the
Hi,
There doesn't seem to be something like this in Phobos:
alias Instantiate(alias Template, T...) = Template!T;
Here's an example of why I need it:
alias staticEx(string msg, string file = __FILE__, size_t line =
__LINE__) =
Instantiate!(.staticEx!(Exception, msg), file, line);
On Thursday, 21 April 2016 at 11:54:27 UTC, rcorre wrote:
Thanks for the tip. Here's the linking code it shows:
cc d.o -o d -m64 -L/usr/lib -L/usr/lib32 -Xlinker
--export-dynamic -Xlinker -Bstatic -lphobos2 -Xlinker -Bdynamic
-lpthread -lm -lrt -ldl
/usr/bin/ld: d.o: relocation R_X86_64_32
On Monday, 21 March 2016 at 10:29:36 UTC, Nordlöw wrote:
I want to enable unittests only at the top-level of a module
compilation.
If I have a module
top.d
that imports
dep1.d
dep2.d
...
which all contain unittests, how do I compile top.d with only
the unittests for top.d
On Monday, 21 March 2016 at 15:25:29 UTC, Adam D. Ruppe wrote:
Yes, compiling 33,000 lines from my libs happened in about one
second.
My experience with slow D builds tends to be that it is caused
by CTFE, not by scale.
These kinds of modules are very different from the ones I'm
working
On Wednesday, 20 April 2016 at 12:32:48 UTC, Tofu Ninja wrote:
Is there a way to shallow copy an object when the type is
known? I cant seem to figure out if there is a standard way. I
can't just implement a copy function for the class, I need a
generic solution.
extern (C) Object
On Thursday, 21 April 2016 at 09:55:30 UTC, Rene Zwanenburg wrote:
On Thursday, 21 April 2016 at 01:20:27 UTC, rcorre wrote:
s/compile/link
I _can_ compile a D library, but as soon as I try to link
anything compiled with DMD it falls over.
What is dmd's verbose output? (add -v switch)
Some
On Thursday, 21 April 2016 at 01:20:27 UTC, rcorre wrote:
s/compile/link
I _can_ compile a D library, but as soon as I try to link
anything compiled with DMD it falls over.
What is dmd's verbose output? (add -v switch)
Some of the things it outputs are the location of the config file
it
On Thursday, 21 April 2016 at 01:20:27 UTC, rcorre wrote:
s/compile/link
I _can_ compile a D library, but as soon as I try to link
anything compiled with DMD it falls over.
Sorry, I didn't see the code in your first post. I tried it
myself (in only have 2.070.2) and it worked fine.
Have
On Wednesday, 20 April 2016 at 19:58:15 UTC, Tofu Ninja wrote:
How does D not have shallow copy? Seems like a very basic
functionality...
You could implement a `dup()` method. `dup` is already used for
shallow copying of arrays, why not reuse it for classes (as a
convention)?
On Wednesday, 20 April 2016 at 19:58:15 UTC, Tofu Ninja wrote:
To implement a copy/paste/duplicate functionality in a game
editor. I have an entity-component system, to duplicate an
entity, all it's components need to be duplicated. I have many
many components, I don't want to rely on manually
33 matches
Mail list logo