On Wednesday, 8 May 2019 at 10:28:26 UTC, Andre Pany wrote:
On Monday, 6 May 2019 at 19:52:23 UTC, Mike Brockus wrote:
Hello everyone I am a Meson build system user and I am new to
the D language, just wondering if there are compiler flags
that I should add, unit testing frameworks, any good
On Monday, 6 May 2019 at 19:52:23 UTC, Mike Brockus wrote:
Hello everyone I am a Meson build system user and I am new to
the D language, just wondering if there are compiler flags that
I should add, unit testing frameworks, any good practices I can
follow and or anything like that also some
On Monday, 6 May 2019 at 19:52:23 UTC, Mike Brockus wrote:
Hello everyone I am a Meson build system user and I am new to
the D language, just wondering if there are compiler flags that
I should add, unit testing frameworks, any good practices I can
follow and or anything like that also some
On Monday, 6 May 2019 at 19:52:23 UTC, Mike Brockus wrote:
Hello everyone I am a Meson build system user and I am new to
the D language, just wondering if there are compiler flags that
I should add, unit testing frameworks, any good practices I can
follow and or anything like that also some
Hello everyone I am a Meson build system user and I am new to the
D language, just wondering if there are compiler flags that I
should add, unit testing frameworks, any good practices I can
follow and or anything like that also some resources would be
helpful thanks. (:
Hi Basile,
Thank you for your code, it allowed me to grasp a little bit more
about how to do things in D.
Vincent
On Monday, 7 November 2016 at 23:03:32 UTC, Picaud Vincent wrote:
I need:
1/ a way to detect compile-time constant vs "dynamic" values
/**
* Indicates if something is a value known at compile time.
*
* Params:
* V = The value to test.
* T = Optional, the expected value type.
On Monday, 7 November 2016 at 23:07:27 UTC, Picaud Vincent wrote:
typo...
auto capacity = max(0,(size_-1)*stride_+1);
To be more correct I have something like:
alias IntergralConstant!(int,0) Zero_c;
alias IntergralConstant!(int,1) One_c;
auto capacity =
On Monday, 7 November 2016 at 22:18:56 UTC, Jerry wrote:
On Monday, 7 November 2016 at 21:37:50 UTC, Picaud Vincent
wrote:
static if ( isIntegralConstant!(typeof(required_capacity())
)
{
}
else
{
}
}
Premature post send by error sorry Well something like:
static if (
On Monday, 7 November 2016 at 21:37:50 UTC, Picaud Vincent wrote:
static if ( isIntegralConstant!(typeof(required_capacity()) )
{
}
else
{
}
}
Premature post send by error sorry Well something like:
static if ( isIntegralConstant!(typeof(required_capacity()) )
On Monday, 7 November 2016 at 21:23:37 UTC, Picaud Vincent wrote:
On Monday, 7 November 2016 at 18:59:24 UTC, Jerry wrote:
On Monday, 7 November 2016 at 18:42:37 UTC, Picaud Vincent
wrote:
template isIntegralConstant(ANY)
{
enum bool
On Monday, 7 November 2016 at 18:59:24 UTC, Jerry wrote:
On Monday, 7 November 2016 at 18:42:37 UTC, Picaud Vincent
wrote:
template isIntegralConstant(ANY)
{
enum bool
isIntegralConstant=__traits(identifier,ANY)=="IntegralConstant";
}
A bit more elegant way of doing that would be:
enum
On Monday, 7 November 2016 at 18:42:37 UTC, Picaud Vincent wrote:
template isIntegralConstant(ANY)
{
enum bool
isIntegralConstant=__traits(identifier,ANY)=="IntegralConstant";
}
A bit more elegant way of doing that would be:
enum isIntegralConstant(T) = is(T : IntegralConstant!U, U...);
Hi all,
I have ~15y of C++ and now I want to test D, because it seems
really intersting and "cleaner" than C++.
As an exercice I m trying to implement something equivalent to
the C++ std::integral_constant in D.
In D:
struct IntegralConstant(T, T VALUE) {
...
}
But I do not
On Thursday, 27 October 2016 at 13:43:26 UTC, Steven
Schveighoffer wrote:
It depends on the size of the file and the expectation of
duplicate words. I'm assuming the number of words is limited,
so you are going to allocate far less data by duping on demand.
In addition, you may incur penalties
On 10/27/16 2:40 AM, Era Scarecrow wrote:
On Tuesday, 25 October 2016 at 14:40:17 UTC, Steven Schveighoffer wrote:
I will note, that in addition to the other comments, this is going to
result in corruption. Simply put, the buffer that 'line' uses is
reused for each line. So the string data used
On 10/22/16 1:25 AM, Mark wrote:
Hello, Im a 3rd year Comp Sci student in Edmonton Alberta, Canada.
Ive learned how to use C, and dabbled in C++ in school. Im also in a Oop
course using Java.
I picked up the book The D Programming Language by Alexrei Alexandrescu
a few years ago.
Lately Im
Dne 22.10.2016 v 11:04 Mike Parker via Digitalmars-d-learn napsal(a):
On Saturday, 22 October 2016 at 08:05:12 UTC, Daniel Kozak wrote:
uint[string] dictionary;
should be
uint[size_t] dictionary;
because size_t is 32bit on x86 system and 64bit on x86_64
and you are trying to put array length
On Saturday, 22 October 2016 at 08:05:12 UTC, Daniel Kozak wrote:
uint[string] dictionary;
should be
uint[size_t] dictionary;
because size_t is 32bit on x86 system and 64bit on x86_64
and you are trying to put array length to dictionary which is
size_t
I believe you meant:
size_t[string];
Dne 22.10.2016 v 07:41 Mark via Digitalmars-d-learn napsal(a):
Thanks for the fast reply.
That did work. But now the error is on the line:
dictionary[word] = newId;
I changed the value to 10, still errors. ??
everything else is as before.
thanks.
uint[string] dictionary;
should
On Saturday, 22 October 2016 at 05:41:34 UTC, Mark wrote:
Thanks for the fast reply.
That did work. But now the error is on the line:
dictionary[word] = newId;
I changed the value to 10, still errors. ??
everything else is as before.
thanks.
For simple single file experiments
Thanks for the fast reply.
That did work. But now the error is on the line:
dictionary[word] = newId;
I changed the value to 10, still errors. ??
everything else is as before.
thanks.
On 22/10/2016 6:25 PM, Mark wrote:
Hello, Im a 3rd year Comp Sci student in Edmonton Alberta, Canada.
Ive learned how to use C, and dabbled in C++ in school. Im also in a Oop
course using Java.
I picked up the book The D Programming Language by Alexrei Alexandrescu
a few years ago.
Lately Im
Hello, Im a 3rd year Comp Sci student in Edmonton Alberta, Canada.
Ive learned how to use C, and dabbled in C++ in school. Im also
in a Oop course using Java.
I picked up the book The D Programming Language by Alexrei
Alexandrescu a few years ago.
Lately Im really wanting to get into D, as
On Fri, 2015-08-21 at 01:22 +, Nicholas Wilson via Digitalmars-d
-learn wrote:
[…]
Keep in mind java may be using green threads as opposed to kernel
threads.
The equivalent in D is a Fiber.
I believe Java itself hasn't used green threads in an awful long time:
Threads are mapped to
On Thu, 2015-08-20 at 20:01 +, tony288 via Digitalmars-d-learn
wrote:
[…]
Now what I would like to know, how would I make this code more
efficient? Which is basically the aim I'm trying to achieve.
Any pointers would be really help full. Should I use
concurrency/parallelism etc..?
I
On Thursday, 20 August 2015 at 15:31:13 UTC, tony288 wrote:
So I wrong some code. But it seems the time to process a shared
struct shared long is always the same. Regardless of adding
paddings.
Should it be different?
On Friday, 21 August 2015 at 12:45:52 UTC, Kagamin wrote:
On Thursday, 20 August 2015 at 15:31:13 UTC, tony288 wrote:
So I wrong some code. But it seems the time to process a
shared struct shared long is always the same. Regardless of
adding paddings.
Should it be different?
Hi
all
On Friday, 21 August 2015 at 02:44:50 UTC, Rikki Cattermole wrote:
On 8/21/2015 3:37 AM, Dejan Lekic wrote:
Keep in mind that in D everything is thread-local by default!
:)
For shared resources use __gshared or shared (although I do
not know for
sure whether shared works or not).
Note:
On 8/21/2015 3:37 AM, Dejan Lekic wrote:
Keep in mind that in D everything is thread-local by default! :)
For shared resources use __gshared or shared (although I do not know for
sure whether shared works or not).
Note: shared is __gshared but with mutex's added.
On Thursday, 20 August 2015 at 20:01:58 UTC, tony288 wrote:
On Thursday, 20 August 2015 at 15:37:35 UTC, Dejan Lekic wrote:
[...]
Thanks, I changed the code and the previous one was already
using shared.
import std.stdio;
import core.time;
import core.thread;
[...]
Keep in mind java may
with both to 1
understand more D and see the results of false sharing.
So I wrong some code. But it seems the time to process a shared
struct shared long is always the same. Regardless of adding
paddings.
My thoughts is that as I'm new to D. That it can only be my fault
and not doing things
Keep in mind that in D everything is thread-local by default! :)
For shared resources use __gshared or shared (although I do not
know for sure whether shared works or not).
On Thursday, 20 August 2015 at 15:37:35 UTC, Dejan Lekic wrote:
Keep in mind that in D everything is thread-local by default! :)
For shared resources use __gshared or shared (although I do not
know for sure whether shared works or not).
Thanks, I changed the code and the previous one was
Game.Game.Game conflicts with import
Game.Game.Game at
source/Game/Game.d(2) (spacecraft)
I figure it's because I did imports wrong or something. I'm
still very
new to D. Can anyone help?
The problem is with having three constructs with the same name:
package, module, and class.
I would use lowercase
imports wrong or something. I'm still very
new to D. Can anyone help?
The problem is with having three constructs with the same name: package,
module, and class.
I would use lowercase for package, and module names, and differentiate
between the package and the module:
.../source/foogame/game.d
still
very new to D. Can anyone help?
scottrick Wrote:
T[] rawRead(T)(T[] buffer);
I understand that T is generic type, but I am not sure of the
meaning of the (T) after the method name.
That T is defining the symbol to represent the generic type. It can have more
than one and D provides other things like aliases... Another
Thanks, your post was very helpful. Two more questions (probably
related):
Where is the function 'format' defined? Also, what is that 'unittest'
block? It compiles fine as is, but if I refer to format outside of
unittest, it will not compile. Also, if I compile and run your
example, it
scottrick:
Where is the function 'format' defined?
You need to add at the top of the module:
import std.conv: format;
Or:
import std.conv;
Also, what is that 'unittest' block? It compiles fine as is, but if I refer
to format outside of
unittest, it will not compile. Also, if I compile
Am 06.02.2011 19:38, schrieb Jesse Phillips:
scottrick Wrote:
T[] rawRead(T)(T[] buffer);
I understand that T is generic type, but I am not sure of the
meaning of the (T) after the method name.
That T is defining the symbol to represent the generic type. It can have more
than one and D
Hi,
I am new to D. I am trying to write a binary file parser for a
project of mine and I thought it would be fun to try and learn a new
language at the same time. So I chose D! :D I have been
struggling however and have not been able to find very many good
examples, so I am posting
On 02/05/2011 06:26 PM, scottrick wrote:
Hi,
I am new to D. I am trying to write a binary file parser for a
project of mine and I thought it would be fun to try and learn a new
language at the same time. So I chose D! :D I have been
struggling however and have not been able to find very
spir:
Out[] map (In, Out) (In[] source, Out delegate (In) f) {
// (0)
...
string hex (uint i) { return format(0x%03X, i); }
uint[] decs = [1, 3, 9, 27, 81, 243, 729];
auto hexes = map!(uint,string)(decs, hex);
...
(0) The func must be declared as delegate (instead of
On Sun, 29 Mar 2009 17:43:51 +0200, torhu wrote:
On 29.03.2009 17:04, chris wrote:
Alright so I'm not too familiar with building D or having to build
multiple files from the command line (Java usually takes care of that).
Basically I have a small game I put together as a test project. Here's
chris schrieb:
The file clo.d is in module clo; while GameState is in module
slo.common;
you probably mean it is in package clo.
Also thanks for the link, I was going to ask about .conf files.
You're welcome.
chris wrote:
Alright so I'm not too familiar with building D or having to build
multiple files from the command line (Java usually takes care of
that). Basically I have a small game I put together as a test
project. Here's the structure:
clo/clo.d
clo/Main.d
clo/common/GameState.d
clo is in
Yea I just realized it follows the directory structure and not some
arbitrary system I made up.
Thanks for the .config info, I was just putting one together of
similar structure, this'll absolutely help.
Much appreciated
48 matches
Mail list logo