Without that, algorithms can't make
guarantees about their complexity, and it could have very
negative impact on
the performance of some programs.
Yeah. For the programs where efficiency matters but that are
never ever profiled.
Hi there,
I'm looking to write a function template that operates only on
value types. Basically I'm looking for an equivalent of
where T: struct
from C# (http://msdn.microsoft.com/en-us/library/d5x73970.aspx)
I was thinking that maybe using
template Foo(T) if (is(T : struct) or is(T:
On Tuesday, 28 October 2014 at 20:24:03 UTC, Steven Schveighoffer
wrote:
It's also O(lgn) on a sorted set, or O(1) on a hash set. So?
As araq points out this should be caught in profiling.
Avoiding generality is not the best approach. A linear scan of a
SIMD friendly array that is in cache
On 29/10/2014 11:01 p.m., Gareth Foster wrote:
Hi there,
I'm looking to write a function template that operates only on value
types. Basically I'm looking for an equivalent of
where T: struct
from C# (http://msdn.microsoft.com/en-us/library/d5x73970.aspx)
I was thinking that maybe using
On Tuesday, 28 October 2014 at 16:07:38 UTC, MachineCode wrote:
I'm very surprise. If they either equal or fast sometimes the
compiler did great optizations or it's just a multicore
processor that's helping or what else? the first version (from
your post, the one using ranges) change in each
On 10/29/2014 1:48 PM, WhatMeWorry wrote:
It looks like dub fetch... is putting all packages at %appdata% path on
my windows machine. Is there a way to redirect packages to a user
specified path?
You're not really supposed to worry about that. It's how dub manages the
packages internally. Why
On Wednesday, 29 October 2014 at 10:01:18 UTC, Gareth Foster
wrote:
Hi there,
I'm looking to write a function template that operates only on
value types. Basically I'm looking for an equivalent of
where T: struct
from C# (http://msdn.microsoft.com/en-us/library/d5x73970.aspx)
I was
https://github.com/D-Programming-Language/dub/issues/229
I'm looking for the D inline assembler equivalent of the .p2align 4,,15
directive to optimize a loop.
Here's more information:
http://stackoverflow.com/questions/21546946/what-p2align-does-in-asm-code
I tried searching through a turbo assembler tutorial (because D's is
based on it) and found
On Wednesday, 29 October 2014 at 17:16:23 UTC, Etienne wrote:
I'm looking for the D inline assembler equivalent of the
.p2align 4,,15 directive to optimize a loop.
Here's more information:
http://stackoverflow.com/questions/21546946/what-p2align-does-in-asm-code
I tried searching through a
On 2014-10-29 1:44 PM, anonymous wrote:
D inline assembler has an 'align' directive [1]. Aligning to a 16
byte boundary in D: `align 16;`.
[1] http://dlang.org/iasm.html -- align IntegerExpression, near
the top
Of course, align directive works on instructions in asm. Thanks
anonymous, that
On Wednesday, 29 October 2014 at 12:47:48 UTC, Kagamin wrote:
https://github.com/D-Programming-Language/dub/issues/229
Thanks. This s-ludwig guy is great.
On Wednesday, 29 October 2014 at 11:35:17 UTC, Mike Parker wrote:
On 10/29/2014 1:48 PM, WhatMeWorry wrote:
It looks like dub fetch... is putting all packages at
%appdata% path on
my windows machine. Is there a way to redirect packages to a
user
specified path?
You're not really supposed to
Hello,
I would like to create a D function that returns a slice of a
string.
This slice shall be a reference to a part of the string argument.
Is this generally possible in D?
This is the function:
auto ref betweenTwoStrings(T)(inout T src, string start, string
end) {
long a =
advibm:
I would like to have something like that:
char[] buf; // already filled array
char[] partOfBuf = betweenTwoStrings(buf, START, END);
partOfBuf[0] = 'a'; // THIS should also change the 'buf'
variable
assert(buf[0] == 'a');
Thanks for your help
To do this you don't need to return a
On Wednesday, 29 October 2014 at 19:54:45 UTC, bearophile wrote:
advibm:
I would like to have something like that:
char[] buf; // already filled array
char[] partOfBuf = betweenTwoStrings(buf, START, END);
partOfBuf[0] = 'a'; // THIS should also change the 'buf'
variable
assert(buf[0] ==
I have this simple code:
int main()
{
import std.stdio;
char[4096] Input;
readln(Input);
//readln!(char)(Input); // also fails
return 0;
}
I get these messages during compilation:
test.d(39): Error: template std.stdio.readln cannot deduce
function from
argument types
You need to take a slice of the buffer:
char[] buf = Input[];
readln(buf);
// line now in buf
The reason for this is because you need to know where the string
ends. If you just passed in Input, how would you know how long
the line read was?
On Wednesday, 29 October 2014 at 21:14:17 UTC, dcrepid wrote:
I have this simple code:
int main()
{
import std.stdio;
char[4096] Input;
readln(Input);
//readln!(char)(Input); // also fails
return 0;
}
I get these messages during compilation:
test.d(39): Error: template
On Wed, 29 Oct 2014 21:14:13 +
dcrepid via Digitalmars-d-learn digitalmars-d-learn@puremagic.com
wrote:
Now, I'm used to 'buffer' meaning one thing, but here it seems
that buffer means something more akin to a 'sink' object, or a
forced dynamic array type? Is there some way I can avoid
On 10/29/2014 12:50 PM, advibm wrote:
Hello,
I would like to create a D function that returns a slice of a string.
This slice shall be a reference to a part of the string argument.
Is this generally possible in D?
This is the function:
auto ref betweenTwoStrings(T)(inout T src, string start,
Hi.
I have had a look around for these, but was not able to see them.
It looks perhaps like dart_api.h is the main file to convert - I
will have a crack at starting this unless anyone knows of any
already in existence.
Rationale for using Dart in combination with D is that I am not
On Wed, 29 Oct 2014 22:12:30 +
Laeeth Isharc via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
it's OT, but haven't you tried Adam Ruppe's script.d? it has d-like
syntax with influences from javascript, written entirely in D, and has
simple interoperability with D code.
it's
On Wednesday, 29 October 2014 at 21:19:25 UTC, Peter Alexander
wrote:
You need to take a slice of the buffer:
char[] buf = Input[];
readln(buf);
// line now in buf
The reason for this is because you need to know where the
string ends. If you just passed in Input, how would you know
how long
err, I meant rvalue *reference* above
lol, if only I could edit my posts. The comment preceding the
readln() call was wrong too. This is what I have now:
// readln(buf) requires a slice *Reference*.
// rvalue references aren't supported by D, so readln(Input[])
fails
On Wed, 29 Oct 2014 23:10:10 +, dcrepid wrote:
On Wednesday, 29 October 2014 at 21:19:25 UTC, Peter Alexander wrote:
You need to take a slice of the buffer:
char[] buf = Input[];
readln(buf);
// line now in buf
The reason for this is because you need to know where the string ends.
If
On 2014-10-29 18:12, Laeeth Isharc wrote:
Rationale for using Dart in combination with D is that I am not thrilled
about learning or writing in Javascript, yet one has to do processing on
the client in some language, and there seem very few viable alternatives
for that. It would be nice to run
On Wednesday, 29 October 2014 at 23:28:07 UTC, Justin Whear wrote:
Part of what readln does is *modify* the slice itself, not just
the
pointed-to
characters. In particular it alters the length member so that
you know
how much
input was actually read. This is also why the rvalue reference
On Wednesday, 29 October 2014 at 22:12:32 UTC, Laeeth Isharc
wrote:
I will have a crack at starting this unless anyone knows of any
already in existence.
I haven't heard of any.
Rationale for using Dart in combination with D is that I am not
thrilled about learning or writing in Javascript,
On Wednesday, 29 October 2014 at 22:22:39 UTC, ketmar via
Digitalmars-d-learn wrote:
it's not lightning fast, though, but the code is understandable
and it's fairly easy to extend the language if necessary.
Curious, what have you tried with it?
I wanted to keep it simple but actually
Hi Folks,
Quick question, how do I get pointer to a class constructor, let's say
default constructor? I want to set it to AA, but couldn't find a way.
Thanks!
--Toshiaki
You can access constructors just like any other method if you use
the __ctor name.
So like MyClass.__ctor.
On Thu, 30 Oct 2014 01:31:23 +
Adam D. Ruppe via Digitalmars-d-learn
digitalmars-d-learn@puremagic.com wrote:
On Wednesday, 29 October 2014 at 22:22:39 UTC, ketmar via
Digitalmars-d-learn wrote:
it's not lightning fast, though, but the code is understandable
and it's fairly easy to
On Wednesday, 29 October 2014 at 22:12:32 UTC, Laeeth Isharc
wrote:
I have had a look around for these, but was not able to see
them.
It looks perhaps like dart_api.h is the main file to convert -
I will have a crack at starting this unless anyone knows of any
already in existence.
Dart VM
35 matches
Mail list logo