On Monday, 24 February 2014 at 19:41:57 UTC, Remo wrote:
For Vector example this works pretty well this way.
But my main problem is more complicated.
extern(C) int init(ref CWrapper p);
extern(C) void free(ref CWrapper p);
struct CWrapper
{
//some data that must be the same at C side.
Data
On Tuesday, 25 February 2014 at 06:06:22 UTC, Jesse Phillips
wrote:
On Monday, 24 February 2014 at 20:35:54 UTC, Remo wrote:
This looks like D2 is still in Beta stadium and not really
ready for production use !?
If someone thinks that C++ was production ready in 1998, just go
and try a C++ co
On Monday, 24 February 2014 at 18:40:14 UTC, monarch_dodra wrote:
Also, a "qstring" can only contain valid D tokens ("token
string"). If your mixin string does not adhere some the base D
syntaxic rules, you'll get a compilation error. In particular,
you'll need balanced bracing/parenthesising,
On Monday, 24 February 2014 at 20:35:54 UTC, Remo wrote:
This looks like D2 is still in Beta stadium and not really
ready for production use !?
I believe it is ready for production, but you can't expect it to
be ready in all cases. Mostly its lack of readiness isn't because
of the language th
On Monday, 24 February 2014 at 23:34:51 UTC, Remo wrote:
Where I can find more info about 'D's move semantics'?
Apparently it is not the same as rvalue reference and move
semantics in C++11 ?
Here is the place I know of:
http://dconf.org/2013/talks/cehreli.html
On Sunday, 23 February 2014 at 20:46:47 UTC, Jesse Phillips wrote:
On Sunday, 23 February 2014 at 08:32:50 UTC, Danny Arends wrote:
I have a medium sized project at:
https://github.com/DannyArends/DaNode
it compiles fine with the normal build switches I used:
$ rdmd --build-only -O -gc -rel
On Monday, 24 February 2014 at 21:06:03 UTC, monarch_dodra wrote:
On Monday, 24 February 2014 at 17:15:10 UTC, Remo wrote:
So what is proper/best way to mimic default constructor for
struct ?
Honestly, you can't, and you shouldn't try either. There "used"
to be the static opCall that allowed:
Gary Willoughby wrote:
> I keep seeing this syntax used a bit and i'm stumped to what it
> means. What is it?
>
> enum foo = q{
> // ???
> };
q{} string literals (so-called "token strings") are a nice D feature - D
garantees that tokens in between brackets are valid D tokens. This makes
th
On 02/24/2014 12:20 PM, Tolga Cakiroglu wrote:
> I have about 12 different separate programmes. While compiling only one
> of them, it gives as warning as below:
>
> /usr/include/dmd/phobos/std/mmfile.d(344): Deprecation: alias
> core.sys.posix.sys.mman.MAP_ANON is deprecated - Please use
> core.
On Mon, 24 Feb 2014 16:24:00 -0500, Frustrated wrote:
On Monday, 24 February 2014 at 18:59:32 UTC, Steven Schveighoffer
wrote:
On Mon, 24 Feb 2014 11:36:50 -0500, Frustrated
wrote:
http://dpaste.dzfl.pl/c25655e2dfe9
The code above simplifies using interfaces as the programming
object. It
On Mon, 24 Feb 2014 15:19:06 -0500, Hugo Florentino wrote:
> On Mon, 24 Feb 2014 19:08:16 + (UTC), Justin Whear wrote:
>>
>> Specifically std.regex.splitter[1] creates a lazy range over the input.
>> You can couple this with lazy file reading (e.g.
>> `File("mailbox").byChunk (1024).joiner`).
Fixed code with all combination examples:
(again, only WindowsButton works with WindowsGui and same for
LinuxGui... but the classes don't use iButton like they should!!!
Oh, they break the contract!! End of the world!)
http://dpaste.dzfl.pl/02ee45225303
Output:
Trying WindowsButton with Window
On Monday, 24 February 2014 at 18:59:32 UTC, Steven Schveighoffer
wrote:
On Mon, 24 Feb 2014 11:36:50 -0500, Frustrated
wrote:
http://dpaste.dzfl.pl/c25655e2dfe9
The code above simplifies using interfaces as the programming
object. It allows one to program the derived classes as if they
were
On Monday, 24 February 2014 at 17:15:10 UTC, Remo wrote:
So what is proper/best way to mimic default constructor for
struct ?
Honestly, you can't, and you shouldn't try either. There "used"
to be the static opCall that allowed:
auto a = T();
But:
a) This is being phased out: If T h
On 2/24/14, 12:40, monarch_dodra wrote:
Also, a "qstring" can only contain valid D tokens ("token string"). If
your mixin string does not adhere some the base D syntaxic rules, you'll
get a compilation error. In particular, you'll need balanced
bracing/parenthesising, and correctly formed tokens
Also please take a look at those:
https://d.puremagic.com/issues/show_bug.cgi?id=7066
There may be some others I've missed; the sheer amount and
unresolved state is terrifying.
IMHO Issue 7066 is not a bug but a feature.
Of course it could be handled i a bit more safe way.
This looks like
I have about 12 different separate programmes. While compiling
only one of them, it gives as warning as below:
/usr/include/dmd/phobos/std/mmfile.d(344): Deprecation: alias
core.sys.posix.sys.mman.MAP_ANON is deprecated - Please use
core.sys.linux.sys.mman for non-POSIX extensions
I used `g
On Mon, 24 Feb 2014 19:08:16 + (UTC), Justin Whear wrote:
Specifically std.regex.splitter[1] creates a lazy range over the
input.
You can couple this with lazy file reading (e.g.
`File("mailbox").byChunk
(1024).joiner`).
Would something like this work? (I cannot test it right now)
aut
Fortunately?
Yes I think it is. Of course it could be made a more safe in some
way.
I think the big advantage of D is that it has 'bridge' to C and
C++.
This way it appears to be easy to port some C++ code to D.
And it appears to be easy to interconnect C++ and D code. (via
Dll for example)
On Mon, 24 Feb 2014 14:17:14 -0500, Hugo Florentino wrote:
On Mon, 24 Feb 2014 14:00:09 -0500, Steven Schveighoffer wrote:
std.regex
I should have explained myself better.
I have already used regular expressions a couple of times. My doubt here
is how parse the file progressively, not loa
On Mon, 24 Feb 2014 19:08:16 + (UTC), Justin Whear wrote:
Specifically std.regex.splitter[1] creates a lazy range over the
input.
You can couple this with lazy file reading (e.g.
`File("mailbox").byChunk
(1024).joiner`).
Interesting, thanks.
On Mon, 24 Feb 2014 14:00:09 -0500, Steven Schveighoffer wrote:
std.regex
I should have explained myself better.
I have already used regular expressions a couple of times. My doubt
here is how parse the file progressively, not loading it completely into
memory.
If this can be done solely wi
On Mon, 24 Feb 2014 14:00:09 -0500, Steven Schveighoffer wrote:
> On Mon, 24 Feb 2014 13:52:45 -0500, Hugo Florentino
> wrote:
>
>> Hello,
>>
>> Can you point me to an efficient way to parse a text file and split it
>> by certain expression (for example, `\n\nFrom\ .+@.+$`), copying what
>> has
On Mon, 24 Feb 2014 13:52:45 -0500, Hugo Florentino wrote:
Hello,
Can you point me to an efficient way to parse a text file and split it
by certain expression (for example, `\n\nFrom\ .+@.+$`), copying what
has already been read to a separate file, and so on till the end of the
file?
I
On Mon, 24 Feb 2014 11:36:50 -0500, Frustrated wrote:
http://dpaste.dzfl.pl/c25655e2dfe9
The code above simplifies using interfaces as the programming
object. It allows one to program the derived classes as if they
were not part of an abstraction by mapping the abstracted virtual
methods to co
Hello,
Can you point me to an efficient way to parse a text file and split it
by certain expression (for example, `\n\nFrom\ .+@.+$`), copying what
has already been read to a separate file, and so on till the end of the
file?
I am trying to implement a mailbox to maildir format conversion
a
On Monday, 24 February 2014 at 17:11:20 UTC, Joseph Cassman wrote:
The const/immutable language spec page states that mutable and
immutable are implicitly convertible to const. Never thought
about this in the other direction though. And from what I
understand, the const keyword added to a funct
On Monday, 24 February 2014 at 17:47:55 UTC, 1100110 wrote:
On 2/24/14, 11:06, Gary Willoughby wrote:
On Monday, 24 February 2014 at 11:53:00 UTC, anonymous wrote:
On Monday, 24 February 2014 at 11:47:02 UTC, Namespace wrote:
On Monday, 24 February 2014 at 11:41:41 UTC, Gary Willoughby
wrote:
On Monday, 24 February 2014 at 17:15:10 UTC, Remo wrote:
Well fortunately it seems to be possible to override init
property.
Fortunately? I think not. It's an abomination that, IMO, has to
be annihilated. Recently Andrei suggested adding more explicit
semantics to .init that may give some le
On Monday, 24 February 2014 at 17:24:18 UTC, Ali Çehreli wrote:
On 02/24/2014 09:11 AM, Joseph Cassman wrote:
> the const keyword added to a [member] function makes the this
pointer
> const. Can't see exactly why this works but it does.
const means "I will not modify data through this reference
On 2/24/14, 11:06, Gary Willoughby wrote:
On Monday, 24 February 2014 at 11:53:00 UTC, anonymous wrote:
On Monday, 24 February 2014 at 11:47:02 UTC, Namespace wrote:
On Monday, 24 February 2014 at 11:41:41 UTC, Gary Willoughby wrote:
I keep seeing this syntax used a bit and i'm stumped to what
On 02/24/2014 09:11 AM, Joseph Cassman wrote:
> the const keyword added to a [member] function makes the this pointer
> const. Can't see exactly why this works but it does.
const means "I will not modify data through this reference". Since there
is not issue with modification, it can refer to m
On Monday, 24 February 2014 at 14:14:43 UTC, Tobias Pankrath
wrote:
On Monday, 24 February 2014 at 13:56:01 UTC, Remo wrote:
Hi,
right now I am truing to figure out how the constructors
behave in D2.
Question 1: why it is not possible to create custom ctor for
struct?
The design of D reli
On Monday, 24 February 2014 at 11:37:43 UTC, anonymous wrote:
Mark opSlice const then.
That did it. Thanks.
The const/immutable language spec page states that mutable and
immutable are implicitly convertible to const. Never thought
about this in the other direction though. And from what I
u
On Monday, 24 February 2014 at 11:53:00 UTC, anonymous wrote:
On Monday, 24 February 2014 at 11:47:02 UTC, Namespace wrote:
On Monday, 24 February 2014 at 11:41:41 UTC, Gary Willoughby
wrote:
I keep seeing this syntax used a bit and i'm stumped to what
it means. What is it?
enum foo = q{
//
>>> On Monday, 24 February 2014 at 11:41:41 UTC, Gary Willoughby wrote:
I keep seeing this syntax used a bit and i'm stumped to what it means.
What is it?
enum foo = q{
// ???
};
>> It's a token string though, not a delimited string. See the
>> section "Token Strings" on
http://dpaste.dzfl.pl/c25655e2dfe9
The code above simplifies using interfaces as the programming
object. It allows one to program the derived classes as if they
were not part of an abstraction by mapping the abstracted virtual
methods to concrete methods.
e.g.,
class WindowsGui : iGui
{
On Monday, 24 February 2014 at 13:08:52 UTC, Mengu wrote:
On Monday, 24 February 2014 at 11:29:39 UTC, bearophile wrote:
TheFlyingFiddle:
http://dlang.org/phobos/std_array.html#.uninitializedArray is
what you want.
The OP wants minimallyInitializedArray. uninitializedArray is
only for speci
On Sun, 2014-02-23 at 22:55 -0800, Ali Çehreli wrote:
[…]
> On my quad-core Intel I get the following (I have two actual cores, four
> hyperthreads):
>
> 3.14159 took 441[ms]
> 3.14159 took 878[ms]
> Speedup 1.99093
> -5.80829e+09 took 98[ms]
> -5.80829e+09 took 328[ms]
> Speedup 3.34694
>
> I a
On Sat, 2014-02-22 at 16:21 +, "Nordlöw" wrote:
> In the following test code given below of std.parallelism I get
> some interesting results:
>
> when compiled as
>
> dmd -release -noboundscheck -O -inline -w -wi -wi
> ~/Work/justd/t_parallelism.d -oft_parallelism
>
> My scalability measu
On Monday, 24 February 2014 at 13:56:01 UTC, Remo wrote:
Hi,
right now I am truing to figure out how the constructors behave
in D2.
Question 1: why it is not possible to create custom ctor for
struct?
The design of D relies on the fact that every type has a T.init
property that is known t
Hi,
right now I am truing to figure out how the constructors behave
in D2.
Question 1: why it is not possible to create custom ctor for
struct?
I know this is not really necessary because you can initialize
fields like this.
struct S{ int i = 1; }
But this is a big problem if one tries to
Mengu:
what's the difference?
After you have read the online docs of both function what's your
best guess of an answer?
Bye,
bearophile
On Monday, 24 February 2014 at 11:29:39 UTC, bearophile wrote:
TheFlyingFiddle:
http://dlang.org/phobos/std_array.html#.uninitializedArray is
what you want.
The OP wants minimallyInitializedArray. uninitializedArray is
only for special situations. Perhaps we have to fix the online
docs to u
On 2/24/14, bearophile wrote:
> The OP wants minimallyInitializedArray. uninitializedArray is
> only for special situations.
There needs to be a ddoc-ed sample demonstrating *exactly* what the
difference between minimallyInitializedArray and uninitializedArray
is.
On Monday, 24 February 2014 at 12:08:31 UTC, Nordlöw wrote:
On Monday, 24 February 2014 at 11:29:39 UTC, bearophile wrote:
TheFlyingFiddle:
http://dlang.org/phobos/std_array.html#.uninitializedArray is
what you want.
Wouldn't it be nice to have some kind of syntactic sugar for
this similar
On 02/24/2014 01:08 PM, "Nordlöw" wrote:
On Monday, 24 February 2014 at 11:29:39 UTC, bearophile wrote:
TheFlyingFiddle:
http://dlang.org/phobos/std_array.html#.uninitializedArray is what
you want.
Wouldn't it be nice to have some kind of syntactic sugar for this
similar to what we have for
On Monday, 24 February 2014 at 11:29:39 UTC, bearophile wrote:
TheFlyingFiddle:
http://dlang.org/phobos/std_array.html#.uninitializedArray is
what you want.
Wouldn't it be nice to have some kind of syntactic sugar for this
similar to what we have for static arrays?
BTW: Why isn't simply th
On Monday, 24 February 2014 at 11:53:00 UTC, anonymous wrote:
On Monday, 24 February 2014 at 11:47:02 UTC, Namespace wrote:
On Monday, 24 February 2014 at 11:41:41 UTC, Gary Willoughby
wrote:
I keep seeing this syntax used a bit and i'm stumped to what
it means. What is it?
enum foo = q{
//
On Monday, 24 February 2014 at 11:47:02 UTC, Namespace wrote:
On Monday, 24 February 2014 at 11:41:41 UTC, Gary Willoughby
wrote:
I keep seeing this syntax used a bit and i'm stumped to what
it means. What is it?
enum foo = q{
// ???
};
http://dlang.org/lex.html#DelimitedString
It's a to
On Monday, 24 February 2014 at 11:41:41 UTC, Gary Willoughby
wrote:
I keep seeing this syntax used a bit and i'm stumped to what it
means. What is it?
enum foo = q{
// ???
};
http://dlang.org/lex.html#DelimitedString
I keep seeing this syntax used a bit and i'm stumped to what it
means. What is it?
enum foo = q{
// ???
};
On Monday, 24 February 2014 at 07:02:00 UTC, Joseph Cassman wrote:
I have a custom number type in the works here
(https://github.com/joichiro/kuttaka/commit/a226d3368a64ae63b0c256c4f4a4ede375a5cee8).
The test code for opSlice works in this commit. However, when I
change the auto to immutable (o
TheFlyingFiddle:
http://dlang.org/phobos/std_array.html#.uninitializedArray is
what you want.
The OP wants minimallyInitializedArray. uninitializedArray is
only for special situations. Perhaps we have to fix the online
docs to underline this.
Bye,
bearophile
On Monday, 24 February 2014 at 11:11:44 UTC, Nordlöw wrote:
Is it possible void construct a dynamic array such as b in
int n = 3;
auto b = new float[n];
similar to what we do with static arrays as in
int[3] c = void;
http://dlang.org/phobos/std_array.html#.uninitializedArray is
Is it possible void construct a dynamic array such as b in
int n = 3;
auto b = new float[n];
similar to what we do with static arrays as in
int[3] c = void;
On Saturday, 22 February 2014 at 16:21:21 UTC, Nordlöw wrote:
In the following test code given below of std.parallelism I get
some interesting results:
Don't forget that "n.iota.map" is returning a lazily evaluated
range.
Std.parallelism might have to convert the lazy range to a random
access
On Sunday, 23 February 2014 at 11:49:26 UTC, Marc Schütz wrote:
There's no IFTI here. IFTI is about inferring a template
argument (= type) from the type of a function argument. Your
template argument is a value, not a type, so there's nothing to
infer.
There is the value. In IFTI_Type, the co
I am not an expect at all but it looks like the first test
cannot take advantage of hyperthreading but the second one can
to some degree.
Yes, that is my hypothesis aswell :)
Thx
Don't rely on dmd when making raw performance tests.
On my machine (i3-2100, two cores):
dmd2 -O -release -inline
3.14159 took 368[ms]
3.14159 took 713[ms]
Speedup 1.9375
-5.80829e+09 took 61[ms]
-5.80829e+09 took 201[ms]
Speedup 3.29508
ldc2 -O3 -release
3.14159 took 360[ms]
3.14159 took 718
60 matches
Mail list logo