What does this symbol mean in relation to D?
~
Compiler can't deduce type for template struct Pair when using it
with enum argument. There is an example
import std.stdio;
enum Category { first, second, third };
struct Pair(F, S)
{
F first;
S second;
this(F f, S s)
{
first = f;
On Friday, 27 June 2014 at 06:12:57 UTC, pgtkda wrote:
How I could make this
working without explicit specifying of types?
sorry, i should read better
On Friday, 27 June 2014 at 06:04:20 UTC, Uranuz wrote:
Compiler can't deduce type for template struct Pair when using
it with enum argument. There is an example
import std.stdio;
enum Category { first, second, third };
struct Pair(F, S)
{
F first;
S second;
On Friday, 27 June 2014 at 06:14:48 UTC, pgtkda wrote:
On Friday, 27 June 2014 at 06:12:57 UTC, pgtkda wrote:
How I could make this
working without explicit specifying of types?
sorry, i should read better
Ok. Maybe it was discussed already somewhere, but I am not god in
searching in
On 06/26/2014 10:58 PM, pgtkda wrote:
What does this symbol mean in relation to D?
~
It can be used in two ways:
1) When used as a unary operator, it means bitwise complement:
assert(~0xaa55aa55 == 0x55aa55aa);
2) When used as a binary operator, it means concatenation:
On Friday, 27 June 2014 at 06:21:11 UTC, Uranuz wrote:
On Friday, 27 June 2014 at 06:14:48 UTC, pgtkda wrote:
On Friday, 27 June 2014 at 06:12:57 UTC, pgtkda wrote:
How I could make this
working without explicit specifying of types?
sorry, i should read better
Ok. Maybe it was discussed
On Friday, 27 June 2014 at 06:33:07 UTC, Ali Çehreli wrote:
On 06/26/2014 10:58 PM, pgtkda wrote:
What does this symbol mean in relation to D?
~
It can be used in two ways:
1) When used as a unary operator, it means bitwise complement:
assert(~0xaa55aa55 == 0x55aa55aa);
2) When used
1) After allocating memory by GC.calloc() to place objects on it, what
else should one do? In what situations does one need to call addRoot()
or addRange()?
2) Does the answer to the previous question differ for struct objects
versus class objects?
3) Is there a difference between
I think, D is a typesafe language, therefore you can't use
variables with no type declaration.
One thing you can search for, are templates but even there you
have to define a type:
import std.stdio;
enum Category : string { first = first}
template Pair(T)
{
T t;
T cat;
}
On Friday, 27 June 2014 at 07:03:28 UTC, Ali Çehreli wrote:
1) After allocating memory by GC.calloc() to place objects on
it, what else should one do?
Use std.conv.emplace.
In what situations does one need to call addRoot() or
addRange()?
Add root creates an internal reference within the
Seems that I found answer myself. As far as I understand type
inference is working only for template functions but not struct
or class templates. This is why this not working and enum is not
responsible for that.
I don't know why I use D enough long but I did not remember this
fact.
I realize that my answer isn't completely clear in some cases, if
you still have questions, ask away.
There is proposal exists for this topic
http://wiki.dlang.org/DIP40
On 06/27/2014 12:53 AM, safety0ff wrote:
I realize that my answer isn't completely clear in some cases, if you
still have questions, ask away.
Done! That's why we are here anyway. :p
Ali
Thank you for your responses. I am partly enlightened. :p
On 06/27/2014 12:34 AM, safety0ff wrote:
On Friday, 27 June 2014 at 07:03:28 UTC, Ali Çehreli wrote:
1) After allocating memory by GC.calloc() to place objects on it, what
else should one do?
Use std.conv.emplace.
That much I know.
On Friday, 27 June 2014 at 08:17:07 UTC, Ali Çehreli wrote:
Thank you for your responses. I am partly enlightened. :p
I know you're a knowledgeable person in the D community, I may
have stated many things you already knew, but I tried to answer
the questions as-is.
On 06/27/2014 12:34
On Friday, 27 June 2014 at 08:17:07 UTC, Ali Çehreli wrote:
So, the GC's default behavior is to scan the memory,
necessitating clearing the contents? That seems to make
GC.malloc() behave the same as GC.calloc() by default, doesn't
it?
Yes.
compare:
On Friday, 27 June 2014 at 09:20:53 UTC, safety0ff wrote:
Yes.
compare:
https://github.com/D-Programming-Language/druntime/blob/master/src/gc/gc.d#L543
to:
https://github.com/D-Programming-Language/druntime/blob/master/src/gc/gc.d#L419
Actually, I just realized that I was wrong in saying the
On Friday, 27 June 2014 at 08:17:07 UTC, Ali Çehreli wrote:
Thank you for your responses. I am partly enlightened. :p
On 06/27/2014 12:34 AM, safety0ff wrote:
On Friday, 27 June 2014 at 07:03:28 UTC, Ali Çehreli wrote:
But addRange doesn't seem to make sense for stdlib.malloc'ed
memory,
Hi,
I have a linux network and i would like to know if they are a D
library to communicate between computer efficiently.
I do not know if that is better to use websocket and if they
exists into dlang:
-
http://planet.jboss.org/post/rest_vs_websocket_comparison_and_benchmarks
Thanks for
On Friday, 27 June 2014 at 05:58:14 UTC, pgtkda wrote:
What does this symbol mean in relation to D?
~
~ D means it's about the best language I've come across so far.
On Friday, 27 June 2014 at 12:51:45 UTC, bioinfornatics wrote:
I do not know if that is better to use websocket and if they
exists into dlang:
you could use websocket in D but if you are talking between two
separate D programs you can just use a regular socket
On Friday, 27 June 2014 at 12:51:45 UTC, bioinfornatics wrote:
Hi,
I have a linux network and i would like to know if they are a D
library to communicate between computer efficiently.
I do not know if that is better to use websocket and if they
exists into dlang:
-
On Friday, 27 June 2014 at 13:03:20 UTC, John Colvin wrote:
On Friday, 27 June 2014 at 12:51:45 UTC, bioinfornatics wrote:
Hi,
I have a linux network and i would like to know if they are a
D library to communicate between computer efficiently.
I do not know if that is better to use
On Friday, 27 June 2014 at 13:02:55 UTC, Adam D. Ruppe wrote:
On Friday, 27 June 2014 at 12:51:45 UTC, bioinfornatics wrote:
I do not know if that is better to use websocket and if they
exists into dlang:
you could use websocket in D but if you are talking between two
separate D programs you
On Fri, Jun 27, 2014 at 06:04:18AM +, Uranuz via Digitalmars-d-learn wrote:
Compiler can't deduce type for template struct Pair when using it with
enum argument. There is an example
import std.stdio;
enum Category { first, second, third };
struct Pair(F, S)
{
F first;
On Friday, 27 June 2014 at 07:43:27 UTC, Uranuz wrote:
I don't know why I use D enough long but I did not remember
this fact.
Sometimes we get spoiled by all the amazing/nifty things that do
work, and expect comparable things like this to Just Work. To be
honest, at first I didn't see any
On Friday, 27 June 2014 at 14:27:46 UTC, H. S. Teoh via
Digitalmars-d-learn wrote:
Try this:
Get out of my head!
On Friday, 27 June 2014 at 05:26:09 UTC, Puming wrote:
On Thursday, 26 June 2014 at 08:02:24 UTC, bearophile wrote:
Puming:
I'm using scriptlike, which imports everything from
std.process for convienience, but I also need to import
another module, which contains a class `Config`, it
Cosider this:
ulong regexChk(string haystack, string needle)
{
// haystack and needle are okey
auto r = regex(needle, g);
auto m = match(haystack, r);
// up to here is all fine
return m.hit().count();
}
I want to count the numbers needles is mathced in haystack
But I get
On Fri, Jun 27, 2014 at 03:59:47PM +, seany via Digitalmars-d-learn wrote:
[...]
core.exception.AssertError@std.regex(5587): Assertion failure
./niarbyl(_d_assertm+0x26) [0x4e6c26]
./niarbyl() [0x4f45be]
./niarbyl(pure nothrow @property @trusted immutable(char)[]
Try to make a faster one than http://dpaste.dzfl.pl/aa2ad03cb0dd
Post your reply here, existing entries must be included.
On Friday, 27 June 2014 at 07:34:55 UTC, safety0ff wrote:
On Friday, 27 June 2014 at 07:03:28 UTC, Ali Çehreli wrote:
1) After allocating memory by GC.calloc() to place objects on
it, what else should one do?
Use std.conv.emplace.
And possibly set BlkInfo flags to indicate whether the block
On 06/27/2014 01:49 AM, safety0ff wrote:
On Friday, 27 June 2014 at 08:17:07 UTC, Ali Çehreli wrote:
Thank you for your responses. I am partly enlightened. :p
I know you're a knowledgeable person in the D community, I may have
stated many things you already knew, but I tried to answer the
35 matches
Mail list logo