Re: Does D have object wrappers for primitives?

2016-07-30 Thread Cauterite via Digitalmars-d-learn
On Saturday, 30 July 2016 at 04:12:45 UTC, stunaep wrote: Thank you. This is just what I needed. I am curious though as to why this doesn't work with strings. It would work if I removed immutable from the Boxed constructor but I thought strings were immutable. I get a compiler error 'not

Re: Why D isn't the next "big thing" already

2016-07-30 Thread ketmar via Digitalmars-d-learn
On Saturday, 30 July 2016 at 12:18:08 UTC, LaTeigne wrote: it you think that you know the things better than somebody who actually *lived* there in those times... well, keep thinking that. also, don't forget to teach physics to physicians, medicine to medics, and so on. i'm pretty sure that

Re: How do you test whether a variable is static or not?

2016-07-30 Thread Basile B. via Digitalmars-d-learn
On Saturday, 30 July 2016 at 12:47:10 UTC, Jonathan M Davis wrote: I'm writing some serialization code where I need to skip static variables. So, I have a symbol from a struct, and I'd like to test whether it's static or not. Ideally, I'd be able to do something like is(field == static) but

Re: Why D isn't the next "big thing" already

2016-07-30 Thread ketmar via Digitalmars-d-learn
On Saturday, 30 July 2016 at 11:31:26 UTC, LaTeigne wrote: For example in the 2000's Delphi was incredibly popular in Russia because the holder at this time (so Borland unless it was already Code Gear) sold literally **hundreds** of licenses to the russian education department. actually, no.

Re: How do you test whether a variable is static or not?

2016-07-30 Thread Ali Çehreli via Digitalmars-d-learn
On 07/30/2016 05:47 AM, Jonathan M Davis via Digitalmars-d-learn wrote: > I'm writing some serialization code where I need to skip static variables. > So, I have a symbol from a struct, and I'd like to test whether it's static > or not. static variables don't have the .offsetof property:

How do you test whether a variable is static or not?

2016-07-30 Thread Jonathan M Davis via Digitalmars-d-learn
I'm writing some serialization code where I need to skip static variables. So, I have a symbol from a struct, and I'd like to test whether it's static or not. Ideally, I'd be able to do something like is(field == static) but of course that doesn't work. There is __traits(isStaticFunction, ...),

Re: Why D isn't the next "big thing" already

2016-07-30 Thread LaTeigne via Digitalmars-d-learn
On Saturday, 30 July 2016 at 12:24:55 UTC, ketmar wrote: On Saturday, 30 July 2016 at 12:18:08 UTC, LaTeigne wrote: it you think that you know the things better than somebody who actually *lived* there in those times... well, keep thinking that. also, don't forget to teach physics to

Re: FunctionTypeOf behaves unexpectedly for function pointers?

2016-07-30 Thread Basile B. via Digitalmars-d-learn
On Friday, 29 July 2016 at 13:54:13 UTC, pineapple wrote: This failure seems curious and I haven't been able to understand why it occurs, or whether it might be intentional. For all other callable types, including functions and delegates and types implementing opCall, the assertion passes.

Re: How do you test whether a variable is static or not?

2016-07-30 Thread Basile B. via Digitalmars-d-learn
On Saturday, 30 July 2016 at 13:04:56 UTC, Ali Çehreli wrote: On 07/30/2016 05:47 AM, Jonathan M Davis via Digitalmars-d-learn wrote: > I'm writing some serialization code where I need to skip static variables. > So, I have a symbol from a struct, and I'd like to test whether it's static > or

Re: Why D isn't the next "big thing" already

2016-07-30 Thread LaTeigne via Digitalmars-d-learn
On Saturday, 30 July 2016 at 11:46:11 UTC, ketmar wrote: On Saturday, 30 July 2016 at 11:31:26 UTC, LaTeigne wrote: For example in the 2000's Delphi was incredibly popular in Russia because the holder at this time (so Borland unless it was already Code Gear) sold literally **hundreds** of

Re: How do you test whether a variable is static or not?

2016-07-30 Thread Jonathan M Davis via Digitalmars-d-learn
On Saturday, July 30, 2016 06:04:56 Ali Çehreli via Digitalmars-d-learn wrote: > On 07/30/2016 05:47 AM, Jonathan M Davis via Digitalmars-d-learn wrote: > > I'm writing some serialization code where I need to skip static > > variables. > > > So, I have a symbol from a struct, and I'd like to

Re: Use dup on Containers with const Elements

2016-07-30 Thread Q. Schroll via Digitalmars-d-learn
On Friday, 29 July 2016 at 19:24:59 UTC, Steven Schveighoffer wrote: On 7/29/16 3:00 PM, Q. Schroll wrote: Cases to consider: Arrays and AAs with const(T) Elements, where T is a value or a reference type respectively. [snip] Questions: (1) Why do I have to specify the type here? Why does

Re: Why D isn't the next "big thing" already

2016-07-30 Thread bachmeier via Digitalmars-d-learn
On Saturday, 30 July 2016 at 12:30:55 UTC, LaTeigne wrote: On Saturday, 30 July 2016 at 12:24:55 UTC, ketmar wrote: On Saturday, 30 July 2016 at 12:18:08 UTC, LaTeigne wrote: it you think that you know the things better than somebody who actually *lived* there in those times... well, keep

Re: [OT] Re: Why D isn't the next "big thing" already

2016-07-30 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 30 July 2016 at 23:11:23 UTC, Seb wrote: I would love to see the forum evolve into something similar to reddit I have a strong dislike of reddit (and thus rarely post there), it is really hard to use and the voting system is petty. The D ng isn't perfect, but it is basically

[OT] Re: Why D isn't the next "big thing" already

2016-07-30 Thread Seb via Digitalmars-d-learn
On Saturday, 30 July 2016 at 22:52:23 UTC, bachmeier wrote: On Saturday, 30 July 2016 at 12:30:55 UTC, LaTeigne wrote: On Saturday, 30 July 2016 at 12:24:55 UTC, ketmar wrote: On Saturday, 30 July 2016 at 12:18:08 UTC, LaTeigne wrote: it you think that you know the things better than somebody

Re: [OT] Re: Why D isn't the next "big thing" already

2016-07-30 Thread LaTeigne via Digitalmars-d-learn
On Saturday, 30 July 2016 at 23:11:23 UTC, Seb wrote: On Saturday, 30 July 2016 at 22:52:23 UTC, bachmeier wrote: On Saturday, 30 July 2016 at 12:30:55 UTC, LaTeigne wrote: On Saturday, 30 July 2016 at 12:24:55 UTC, ketmar wrote: On Saturday, 30 July 2016 at 12:18:08 UTC, LaTeigne wrote: it

Re: [OT] Re: Why D isn't the next "big thing" already

2016-07-30 Thread bachmeier via Digitalmars-d-learn
On Saturday, 30 July 2016 at 23:43:33 UTC, Seb wrote: In any case I was trying to say that we could use reddit more actively, we have our own subreddit (https://www.reddit.com/r/d_language), but it's not used for discussions. So maybe killing the bot & actively encouraging a discussion to

Empty LST files?

2016-07-30 Thread Thalamus via Digitalmars-d-learn
I'm running into a problem where when I specify -cov in the DMD compiler command, the coverage LST files are generated, but they're all empty. Has anyone else run into this before? My command line is: dmd -m64 -gc -debug -w -wi -cov -X -Xf"obj\Unit.json" -I\ -deps="obj\Unit.dep" -c

Re: Why D isn't the next "big thing" already

2016-07-30 Thread LaTeigne via Digitalmars-d-learn
On Saturday, 30 July 2016 at 22:52:23 UTC, bachmeier wrote: On Saturday, 30 July 2016 at 12:30:55 UTC, LaTeigne wrote: On Saturday, 30 July 2016 at 12:24:55 UTC, ketmar wrote: On Saturday, 30 July 2016 at 12:18:08 UTC, LaTeigne wrote: it you think that you know the things better than somebody

Template Inheritance

2016-07-30 Thread Gorge Jingale via Digitalmars-d-learn
I like to build structures using template mixins because one can pick and choose functionality at compile time, but still have a relationship between different types. It would be really nice if one could sort of test if a template mixin was "mixed" in(or ideally, struct S : SomeTemplate

Re: [OT] Re: Why D isn't the next "big thing" already

2016-07-30 Thread Seb via Digitalmars-d-learn
On Saturday, 30 July 2016 at 23:33:27 UTC, LaTeigne wrote: On Saturday, 30 July 2016 at 23:11:23 UTC, Seb wrote: On Saturday, 30 July 2016 at 22:52:23 UTC, bachmeier wrote: On Saturday, 30 July 2016 at 12:30:55 UTC, LaTeigne wrote: On Saturday, 30 July 2016 at 12:24:55 UTC, ketmar wrote: On

Re: Why D isn't the next "big thing" already

2016-07-30 Thread bachmeier via Digitalmars-d-learn
On Saturday, 30 July 2016 at 22:58:31 UTC, LaTeigne wrote: On Saturday, 30 July 2016 at 22:52:23 UTC, bachmeier wrote: On Saturday, 30 July 2016 at 12:30:55 UTC, LaTeigne wrote: On Saturday, 30 July 2016 at 12:24:55 UTC, ketmar wrote: On Saturday, 30 July 2016 at 12:18:08 UTC, LaTeigne wrote:

null as parametr

2016-07-30 Thread AntonSotov via Digitalmars-d-learn
import std.stdio; void myFunc(T)(in T val) { static if(is(T == string)) { writeln("string: ", val); } static if(is(T : long)) { writeln("long: ", val); } static if // WHAT HERE ? writeln("null"); } } int main(string[] args)

Re: [OT] Re: Why D isn't the next "big thing" already

2016-07-30 Thread bachmeier via Digitalmars-d-learn
On Sunday, 31 July 2016 at 00:04:41 UTC, Adam D. Ruppe wrote: I have a strong dislike of reddit (and thus rarely post there), it is really hard to use and the voting system is petty. But this would be our own subreddit. I don't disagree if you're talking about r/programming.

Re: null as parametr

2016-07-30 Thread Seb via Digitalmars-d-learn
On Sunday, 31 July 2016 at 05:22:40 UTC, AntonSotov wrote: import std.stdio; void myFunc(T)(in T val) { static if(is(T == string)) { writeln("string: ", val); } static if(is(T : long)) { writeln("long: ", val); } static if // WHAT HERE

Re: null as parametr

2016-07-30 Thread AntonSotov via Digitalmars-d-learn
2 Seb Thank you! is (T: typeof (null)) - very comfortable

Re: Why D isn't the next "big thing" already

2016-07-30 Thread ketmar via Digitalmars-d-learn
On Sunday, 31 July 2016 at 04:32:10 UTC, bachmeier wrote: I wasn't directing my comment at you specifically. I was talking about the direction the thread took, what do you prefer: to have a completely false information, or corrected information for the price of one or two troll-like posts? i

Re: Why D isn't the next "big thing" already

2016-07-30 Thread LaTeigne via Digitalmars-d-learn
On Saturday, 30 July 2016 at 01:32:50 UTC, Karabuta wrote: On Tuesday, 26 July 2016 at 15:11:00 UTC, llaine wrote: Hi guys, I'm using D since a few month now and I was wondering why people don't jump onto it that much and why it isn't the "big thing" already. Everybody is into javascript