Re: Challenge

2016-10-03 Thread Manu via Digitalmars-d
On 4 October 2016 at 14:40, Jonathan M Davis via Digitalmars-d wrote: > [...] > For that matter, even testing whether something is a variable is > surprisingly difficult. True story! I've written that one before... I spent ages trying to get it right! When people say

Re: Challenge

2016-10-03 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, October 04, 2016 14:24:59 Manu via Digitalmars-d wrote: > On 4 October 2016 at 12:30, Jonathan M Davis via Digitalmars-d > > wrote: > > On Tuesday, October 04, 2016 11:13:36 Manu via Digitalmars-d wrote: > >> I'm feeling John's solution is a little bit

Re: Challenge

2016-10-03 Thread Manu via Digitalmars-d
On 4 October 2016 at 12:30, Jonathan M Davis via Digitalmars-d wrote: > On Tuesday, October 04, 2016 11:13:36 Manu via Digitalmars-d wrote: >> I'm feeling John's solution is a little bit simpler. But nice work, thanks! > > So, it is. LOL. I'd actually glanced over

[Issue 16587] split("", "x") should be []

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16587 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 16587] split("", "x") should be []

2016-10-03 Thread via Digitalmars-d-bugs
quot;x") should be "" This reverts commit b438bf5a0653b616ef6debe2a0dfe247d8fc5928. https://github.com/dlang/phobos/commit/e3f842d52a3eedc7c8f6a5e75f26de05d5cf1fea Merge pull request #4836 from CyberShadow/pull-20161003-223010 Fix Issue 16587 - split("", "x") should be "" --

Re: Challenge

2016-10-03 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, October 04, 2016 11:13:36 Manu via Digitalmars-d wrote: > I'm feeling John's solution is a little bit simpler. But nice work, thanks! So, it is. LOL. I'd actually glanced over that post while I was in the middle of getting my version to work, and I read it too quickly, because I

Re: Cannot access template name from within template

2016-10-03 Thread Michael Coulombe via Digitalmars-d
On Tuesday, 4 October 2016 at 00:40:08 UTC, Andrei Alexandrescu wrote: On 10/03/2016 06:32 PM, Stefan Koch wrote: On Monday, 3 October 2016 at 22:28:46 UTC, Andrei Alexandrescu wrote: Consider: template SomethingCool(alias X) { alias Y = X!int; } struct MyStruct(T) { alias A =

Re: debugging mixins

2016-10-03 Thread Stefan Koch via Digitalmars-d
On Tuesday, 4 October 2016 at 01:20:01 UTC, Manu wrote: On 4 October 2016 at 04:21, Stefan Koch via Digitalmars-d wrote: On Monday, 3 October 2016 at 15:23:40 UTC, Jonathan Marler wrote: Yes, having the mixins expanded without the surrounding code would make

Re: debugging mixins

2016-10-03 Thread Manu via Digitalmars-d
On 4 October 2016 at 04:21, Stefan Koch via Digitalmars-d wrote: > On Monday, 3 October 2016 at 15:23:40 UTC, Jonathan Marler wrote: > >> >> Yes, having the mixins expanded without the surrounding code would make it >> difficult to debug in some cases. Maybe

Re: inout delegate

2016-10-03 Thread Manu via Digitalmars-d
On 4 October 2016 at 10:50, Timon Gehr via Digitalmars-d wrote: > On 03.10.2016 05:06, Manu via Digitalmars-d wrote: >> >> Okay, well my current project is blocked on this. I can't progress. >> https://issues.dlang.org/show_bug.cgi?id=16572 > > > Probably you can work

Re: Challenge

2016-10-03 Thread Manu via Digitalmars-d
On 4 October 2016 at 05:01, Jonathan M Davis via Digitalmars-d wrote: > On Monday, October 03, 2016 11:13:52 Jonathan M Davis via Digitalmars-d wrote: >> template isStaticMember(T, string member) >> { >> static if (!__traits(hasMember, T, member)) >> enum

Re: Challenge

2016-10-03 Thread Manu via Digitalmars-d
On 4 October 2016 at 00:25, John Colvin via Digitalmars-d wrote: > On Monday, 3 October 2016 at 13:19:19 UTC, Manu wrote: >> >> Fill in the blank... >> I'm having a really hard time with this. I've made it work with a >> mountain of code, and I want to see what others

Re: inout delegate

2016-10-03 Thread Timon Gehr via Digitalmars-d
On 03.10.2016 05:06, Manu via Digitalmars-d wrote: Okay, well my current project is blocked on this. I can't progress. https://issues.dlang.org/show_bug.cgi?id=16572 Probably you can work around the issue using unsafe type casts.

Re: Cannot access template name from within template

2016-10-03 Thread Andrei Alexandrescu via Digitalmars-d
On 10/03/2016 06:32 PM, Stefan Koch wrote: On Monday, 3 October 2016 at 22:28:46 UTC, Andrei Alexandrescu wrote: Consider: template SomethingCool(alias X) { alias Y = X!int; } struct MyStruct(T) { alias A = SomethingCool!MyStruct; } Inside MyStruct though, a mention of the symbol

[Issue 16588] New: uniq's BidirectionalRange behavior is inconsistent with its InputRange behavior

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16588 Issue ID: 16588 Summary: uniq's BidirectionalRange behavior is inconsistent with its InputRange behavior Product: D Version: D2 Hardware: All OS: All

[Issue 16587] split("", "x") should be [""]

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16587 Vladimir Panteleev changed: What|Removed |Added Summary|split("", "x") should be "" |split("",

[Issue 16587] split("", "x") should be []

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16587 Vladimir Panteleev changed: What|Removed |Added Summary|split("", "x") should be|split("",

[Issue 16536] DMD master does not build on OS X 10.11.6/Xcode 7.3.1

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16536 John Colvin changed: What|Removed |Added CC|

[Issue 15862] dmd thinks functions are strongly pure despite mutable indirections in the return type

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15862 ag0ae...@gmail.com changed: What|Removed |Added Status|RESOLVED|REOPENED Resolution|INVALID

Re: Cannot access template name from within template

2016-10-03 Thread Stefan Koch via Digitalmars-d
On Monday, 3 October 2016 at 22:28:46 UTC, Andrei Alexandrescu wrote: Consider: template SomethingCool(alias X) { alias Y = X!int; } struct MyStruct(T) { alias A = SomethingCool!MyStruct; } Inside MyStruct though, a mention of the symbol MyStruct alone is actually the current

Cannot access template name from within template

2016-10-03 Thread Andrei Alexandrescu via Digitalmars-d
Consider: template SomethingCool(alias X) { alias Y = X!int; } struct MyStruct(T) { alias A = SomethingCool!MyStruct; } Inside MyStruct though, a mention of the symbol MyStruct alone is actually the current instantiation - i.e. a type, not a template. Any known workaround? Thanks,

[Issue 16584] Local import ineffective for mixin templates

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16584 --- Comment #2 from m.bier...@lostmoment.com --- For the record: the best solution is to import the needed modules within the mixin: mixin template bla(string number) { import func; uint globalBla = toNumber(number); } This keeps within the

[Issue 16584] Local import ineffective for mixin templates

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16584 m.bier...@lostmoment.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|---

[Issue 15862] dmd thinks functions are strongly pure despite mutable indirections in the return type

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15862 Walter Bright changed: What|Removed |Added Status|NEW |RESOLVED

[Issue 15735] std.algorithm.iteration.splitter returns empty range

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15735 --- Comment #3 from github-bugzi...@puremagic.com --- Commit pushed to revert-4030-issue15735 at https://github.com/dlang/phobos https://github.com/dlang/phobos/commit/4fa5ff684e946ef82927b6ff3937c27d23470c9a Revert "Fix issue 15735" --

[Issue 16586] Implicit casting of enum with explicit int base type fails

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16586 --- Comment #1 from m.bier...@lostmoment.com --- Current work-around is to explicitly cast all enum members: int[] ints = [cast(int) IntTypeEnumOne.bla, cast(int) IntTypeEnumTwo.bleh]; --

[Issue 16587] split("", "x") should be ""

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16587 --- Comment #1 from Vladimir Panteleev --- Example real-life scenarios: - Comma-delimited lists in program arguments or configuration files. The string variables will be empty unless populated, then split afterwards. -

[Issue 16587] New: split("", "x") should be ""

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16587 Issue ID: 16587 Summary: split("", "x") should be "" Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: regression Priority: P1

[Issue 16586] New: Implicit casting of enum with explicit int base type fails

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16586 Issue ID: 16586 Summary: Implicit casting of enum with explicit int base type fails Product: D Version: D2 Hardware: x86_64 OS: Windows Status: NEW

[Issue 16585] New: dmd thinks function returns unique result despite mutable indirection in parameter

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16585 Issue ID: 16585 Summary: dmd thinks function returns unique result despite mutable indirection in parameter Product: D Version: D2 Hardware: x86_64 OS: Linux

Re: Release candidate vibe.d 0.7.30-rc.1

2016-10-03 Thread Jack Applegame via Digitalmars-d-announce
On Thursday, 29 September 2016 at 13:44:53 UTC, Sönke Ludwig wrote: If no new issues come up, the 0.7.30 release is scheduled for the 9th of October. Please consider https://github.com/rejectedsoftware/vibe.d/issues/1583

[Issue 16584] New: Local import ineffective for mixin templates

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16584 Issue ID: 16584 Summary: Local import ineffective for mixin templates Product: D Version: D2 Hardware: x86_64 OS: Windows Status: NEW Severity: normal

Re: Getting GtkD working with OpenGL

2016-10-03 Thread Chalix via Digitalmars-d-learn
On Monday, 3 October 2016 at 18:00:53 UTC, Mike Wey wrote: The signal functions can be found in the gobject.Signals module. But you should use the GLArea.addOnCreateContext / addOnRender / addOnResize functions to attach a D delegate to the signal. You will still need to link with the OpenGL

[Issue 16583] New: Static module ctor semantic proposition

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16583 Issue ID: 16583 Summary: Static module ctor semantic proposition Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: enhancement

Re: How to make rsplit (like in Python) in D

2016-10-03 Thread Uranuz via Digitalmars-d-learn
On Saturday, 1 October 2016 at 18:33:02 UTC, TheFlyingFiddle wrote: On Saturday, 1 October 2016 at 16:45:11 UTC, Uranuz wrote: [...] There are two reasons why this does not compile. The first has to do with how retro() (and indeed most function in std.range) work with utf-8 strings (eg the

Re: How to make rsplit (like in Python) in D

2016-10-03 Thread pineapple via Digitalmars-d-learn
On Monday, 3 October 2016 at 19:25:59 UTC, Uranuz wrote: When I pass empty string to splitter in most of languages I expect to get list with 1 item (empty string) as a result, but I get error instead. And I see inconsistency in that .front behaves normally, but .back is not. Usually I access

Re: How to make rsplit (like in Python) in D

2016-10-03 Thread Uranuz via Digitalmars-d-learn
On Saturday, 1 October 2016 at 18:55:54 UTC, pineapple wrote: On Saturday, 1 October 2016 at 17:55:08 UTC, Uranuz wrote: On Saturday, 1 October 2016 at 17:32:59 UTC, Uranuz wrote: On Saturday, 1 October 2016 at 17:23:16 UTC, Uranuz wrote: [...] But these example fails. Oops. Looks like a

[Issue 16485] Add trait for determining whether a member variable is static or not

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16485 --- Comment #1 from Jonathan M Davis --- https://github.com/dlang/phobos/pull/4834 --

Re: Challenge

2016-10-03 Thread Jonathan M Davis via Digitalmars-d
On Monday, October 03, 2016 11:13:52 Jonathan M Davis via Digitalmars-d wrote: > template isStaticMember(T, string member) > { > static if (!__traits(hasMember, T, member)) > enum bool isStaticMember = false; > else > { > import std.meta : AliasSeq; > import

Re: Why using wrappers for D?

2016-10-03 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, October 03, 2016 18:05:47 Chalix via Digitalmars-d-learn wrote: > Ah great, now I understand it :) > I thought, import and include would work the same way (taking all > the code in the .h or .d file and pasting it into the other file). > But if import extracts only the definitions, it

Re: debugging mixins

2016-10-03 Thread Stefan Koch via Digitalmars-d
On Monday, 3 October 2016 at 15:23:40 UTC, Jonathan Marler wrote: Yes, having the mixins expanded without the surrounding code would make it difficult to debug in some cases. Maybe generating the entire source with the expanded mixins is another option? mycode.d obj/mycode_processed.d

Re: Challenge

2016-10-03 Thread Ali Çehreli via Digitalmars-d
On 10/03/2016 07:41 AM, Seb wrote: On Monday, 3 October 2016 at 13:19:19 UTC, Manu wrote: Fill in the blank... I'm having a really hard time with this. I've made it work with a mountain of code, and I want to see what others come up with... If you succeed, put it in std.traits! Recommend, use

Re: Why using wrappers for D?

2016-10-03 Thread Mike Wey via Digitalmars-d-learn
On 10/03/2016 07:19 PM, Chalix wrote: On Monday, 3 October 2016 at 13:51:28 UTC, Mike Parker wrote: // wrapfoo.d import foo; // import the foo module from above void myFunc(string s) { import std.string : toStringz; my_func(s.toStringz()); } Thank you for the example, Mike! And

Re: Why using wrappers for D?

2016-10-03 Thread Mike Parker via Digitalmars-d-learn
On Monday, 3 October 2016 at 17:19:47 UTC, Chalix wrote: If I "import foo;" in my project, it will be compiled alongside. So there is no need for an extra library. Same should be for wrapfoo.d. If I "import wrapfoo;", I should just need the C-library "foo", and no D-library "food" right?

Re: Why using wrappers for D?

2016-10-03 Thread Chalix via Digitalmars-d-learn
On Monday, 3 October 2016 at 17:56:46 UTC, ag0aep6g wrote: When you do precompile to a library, you can skip the compilation later. That can save time. True, linking with this library instead of compiling it every time I changed my code will save me a lot of time :)

Re: Why using wrappers for D?

2016-10-03 Thread Ali Çehreli via Digitalmars-d-learn
On 10/03/2016 05:47 AM, Chalix wrote: > what do you mean > by "turn C functions into classes"? Many C APIs are object-oriented in that, they pass the most interesting object as the first parameter: // C struct struct Foo { // ... }; // Factory method (or, "constructor") Foo*

Re: Challenge

2016-10-03 Thread Jonathan M Davis via Digitalmars-d
On Monday, October 03, 2016 08:38:22 Jonathan M Davis via Digitalmars-d wrote: > On Monday, October 03, 2016 23:19:19 Manu via Digitalmars-d wrote: > > Fill in the blank... > > I'm having a really hard time with this. I've made it work with a > > mountain of code, and I want to see what others

Re: Why using wrappers for D?

2016-10-03 Thread Chalix via Digitalmars-d-learn
On Monday, 3 October 2016 at 17:45:55 UTC, Jonathan M Davis wrote: The import statement just tells the D compiler to pull in declarations for the symbols that it needs from those modules. It doesn't actually compile those modules. You still have to give them to the compiler (either all

Re: Getting GtkD working with OpenGL

2016-10-03 Thread Mike Wey via Digitalmars-d-learn
On 10/03/2016 01:50 PM, Chalix wrote: On Sunday, 18 September 2016 at 21:41:45 UTC, Mike Wey wrote: The demo still uses the old GtkGLExt binding, which usually isn't available in de distributions repositories. The newer GLArea is easier to use since it's part of GTK. As for the linker errors,

Re: Why using wrappers for D?

2016-10-03 Thread ag0aep6g via Digitalmars-d-learn
On 10/03/2016 07:19 PM, Chalix wrote: If I "import foo;" in my project, it will be compiled alongside. Not necessarily. dmd won't compile foo unless you tell it to by putting foo.d on the command line. If foo is only imported, dmd parses the file but it doesn't compile it. So there is no

Re: Why using wrappers for D?

2016-10-03 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, October 03, 2016 17:19:47 Chalix via Digitalmars-d-learn wrote: > But there still is one thing, which I don't get: > > If I "import foo;" in my project, it will be compiled alongside. > So there is no need for an extra library. Same should be for > wrapfoo.d. If I "import wrapfoo;", I

Re: Why using wrappers for D?

2016-10-03 Thread Chalix via Digitalmars-d-learn
On Monday, 3 October 2016 at 13:51:28 UTC, Mike Parker wrote: // wrapfoo.d import foo; // import the foo module from above void myFunc(string s) { import std.string : toStringz; my_func(s.toStringz()); } Thank you for the example, Mike! And thanks to all others who support me with

[Issue 16582] [REG2.072.0-b1] ParamterDefaultValueTuple fails to compile for scope paramters

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16582 Sönke Ludwig changed: What|Removed |Added Component|dmd |phobos --

[Issue 16582] New: [REG2.072.0-b1] ParamterDefaultValueTuple fails to compile for scope paramters

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16582 Issue ID: 16582 Summary: [REG2.072.0-b1] ParamterDefaultValueTuple fails to compile for scope paramters Product: D Version: D2 Hardware: All OS: All

Re: Pattern-matching qualifiers with is() expressions

2016-10-03 Thread Jonathan M Davis via Digitalmars-d
On Monday, October 03, 2016 12:40:45 Andrei Alexandrescu via Digitalmars-d wrote: > Am I doing something wrong? This is a fairly basic match, I'm surprised > this hasn't surfaced yet: > > https://issues.dlang.org/show_bug.cgi?id=16581 My guess is that it hasn't been fined primarily because that

Pattern-matching qualifiers with is() expressions

2016-10-03 Thread Andrei Alexandrescu via Digitalmars-d
Am I doing something wrong? This is a fairly basic match, I'm surprised this hasn't surfaced yet: https://issues.dlang.org/show_bug.cgi?id=16581 Andrei

Re: ndslice: feature deprecation voting / discussion

2016-10-03 Thread Relja Ljubobratovic via Digitalmars-d
On Sunday, 2 October 2016 at 16:36:14 UTC, jmh530 wrote: Wouldn't it be more flexible to allow both ways? If D can handle the case without brackets without any issue, why force it? In Matlab, writing ones(2, 2) produces a 2x2 matrix of ones. In numpy, I would write np.ones((2, 2)) I find it

[Issue 16581] New: Template shape misdetected in is() expression

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16581 Issue ID: 16581 Summary: Template shape misdetected in is() expression Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal

Re: Challenge

2016-10-03 Thread Jonathan M Davis via Digitalmars-d
On Monday, October 03, 2016 23:19:19 Manu via Digitalmars-d wrote: > Fill in the blank... > I'm having a really hard time with this. I've made it work with a > mountain of code, and I want to see what others come up with... It's certainly possible that this misses something, but it passes all of

Re: Challenge

2016-10-03 Thread Jonathan M Davis via Digitalmars-d
On Monday, October 03, 2016 23:19:19 Manu via Digitalmars-d wrote: > Fill in the blank... > I'm having a really hard time with this. I've made it work with a > mountain of code, and I want to see what others come up with... > > If you succeed, put it in std.traits! > > Recommend, use latest DMD

Re: debugging mixins

2016-10-03 Thread Jonathan Marler via Digitalmars-d
On Sunday, 2 October 2016 at 03:36:31 UTC, Manu wrote: This comes up a lot. As far as I know, it's not solved. What shall we do? I feel like a simple solution would be to have the compiler emit a _mixin.d file populated with all the mixin expansions beside the .obj files, and have the

[Issue 16572] can't take inout delegate

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16572 --- Comment #4 from anonymous4 --- Oh, right, we have means to select an overload for delegate, we can reuse it here too. --

[Issue 15831] IFTI voldemort type exploding bloat

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15831 --- Comment #14 from anonymous4 --- For stack trace it should be enough (for this example) mymodule.s.Result.foo without parameters even, file and line number should be enough to locate it. --

Re: Challenge

2016-10-03 Thread Seb via Digitalmars-d
On Monday, 3 October 2016 at 13:19:19 UTC, Manu wrote: Fill in the blank... I'm having a really hard time with this. I've made it work with a mountain of code, and I want to see what others come up with... If you succeed, put it in std.traits! Recommend, use latest DMD nightly. I find

Re: Why using wrappers for D?

2016-10-03 Thread Kagamin via Digitalmars-d-learn
On Monday, 3 October 2016 at 12:08:54 UTC, Chalix wrote: Hi All! The documentation of D (https://dlang.org/overview.html#compatibility) says: "Direct Access to C API's Not only does D have data types that correspond to C types, it provides direct access to C functions. There is no need to

Re: Challenge

2016-10-03 Thread Manu via Digitalmars-d
On 3 October 2016 at 23:48, Manu wrote: > On 3 October 2016 at 23:41, Manu wrote: >> I'm finding this rather annoying: >> >> struct S >> { >> static @property int p() { return 10; } >> } >> >> pragma(msg, typeof()); // prints: int function() @property

Re: Challenge

2016-10-03 Thread John Colvin via Digitalmars-d
On Monday, 3 October 2016 at 13:19:19 UTC, Manu wrote: Fill in the blank... I'm having a really hard time with this. I've made it work with a mountain of code, and I want to see what others come up with... template isStaticMember(T, string member) { mixin(`alias mem = T.` ~ member ~

Re: Challenge

2016-10-03 Thread Temtaime via Digitalmars-d
On Monday, 3 October 2016 at 13:19:19 UTC, Manu wrote: Fill in the blank... I'm having a really hard time with this. I've made it work with a mountain of code, and I want to see what others come up with... [...] Dere's a typo static assert( isStaticMember!(S, "iosm"), "!"); Should be iosf

Re: Challenge

2016-10-03 Thread Kagamin via Digitalmars-d
On Monday, 3 October 2016 at 13:41:13 UTC, Manu wrote: I'm finding this rather annoying: struct S { static @property int p() { return 10; } } pragma(msg, typeof()); // prints: int function() @property pragma(msg, is(typeof() == function)); // prints: false It looks like a function... but I

Re: Challenge

2016-10-03 Thread Manu via Digitalmars-d
On 3 October 2016 at 23:50, John Colvin via Digitalmars-d wrote: > On Monday, 3 October 2016 at 13:41:13 UTC, Manu wrote: >> >> I'm finding this rather annoying: >> >> struct S >> { >> static @property int p() { return 10; } >> } >> >> pragma(msg, typeof()); //

Re: Challenge

2016-10-03 Thread Dicebot via Digitalmars-d
On Monday, 3 October 2016 at 13:50:26 UTC, John Colvin wrote: The problem is that function pointers in "is" expressions don't match "function" or "delegate". static assert (is(void delegate() == delegate)); //passes static assert (is(void function() == function)); //fails static assert

Re: Challenge

2016-10-03 Thread Dicebot via Digitalmars-d
On Monday, 3 October 2016 at 13:41:13 UTC, Manu wrote: I'm finding this rather annoying: struct S { static @property int p() { return 10; } } pragma(msg, typeof()); // prints: int function() @property pragma(msg, is(typeof() == function)); // prints: false It looks like a function... but I

Re: Getting consistent behavour for class properties

2016-10-03 Thread Kagamin via Digitalmars-d-learn
I suppose that's https://issues.dlang.org/show_bug.cgi?id=8006

Re: Challenge

2016-10-03 Thread Manu via Digitalmars-d
On 3 October 2016 at 23:41, Manu wrote: > I'm finding this rather annoying: > > struct S > { > static @property int p() { return 10; } > } > > pragma(msg, typeof()); // prints: int function() @property > pragma(msg, is(typeof() == function)); // prints: false > > It looks

Re: Why using wrappers for D?

2016-10-03 Thread Kagamin via Digitalmars-d-learn
On Monday, 3 October 2016 at 12:47:48 UTC, Chalix wrote: Also, I used the Qt library a lot with C++. But although it is a library, I have access to all the classes, like " QWidget w = new QWidget();". There is no factory method used. (This confuses me now a bit...) Qt bindings is a major

Re: Challenge

2016-10-03 Thread John Colvin via Digitalmars-d
On Monday, 3 October 2016 at 13:41:13 UTC, Manu wrote: I'm finding this rather annoying: struct S { static @property int p() { return 10; } } pragma(msg, typeof()); // prints: int function() @property pragma(msg, is(typeof() == function)); // prints: false It looks like a function... but I

Re: Why using wrappers for D?

2016-10-03 Thread Mike Parker via Digitalmars-d-learn
On Monday, 3 October 2016 at 12:08:54 UTC, Chalix wrote: Furthermore, if there is an not very popular C library, where no wrapper function exists, would it possible to include it into a D project? Probably I have to transform all the .h to .d files, so i can "import" them instead of "include"

Re: Challenge

2016-10-03 Thread Andrea Fontana via Digitalmars-d
On Monday, 3 October 2016 at 13:19:19 UTC, Manu wrote: Fill in the blank... I'm having a really hard time with this. I've made it work with a mountain of code, and I want to see what others come up with... If you succeed, put it in std.traits! Pretty easy: template isStaticMember(T, string

Re: Why using wrappers for D?

2016-10-03 Thread Kagamin via Digitalmars-d-learn
On Monday, 3 October 2016 at 13:12:55 UTC, Chalix wrote: But I don't get, why I have a gtkd-3 lib. Why can't I just link against the gtk-3 lib then? I have now the headers to use the nice D stuff, but the linking should be done against the C-compiled library. If you don't use D-specific

[Issue 15831] IFTI voldemort type exploding bloat

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=15831 Martin Nowak changed: What|Removed |Added CC||c...@dawg.eu --- Comment #13

[Issue 16572] can't take inout delegate

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16572 Steven Schveighoffer changed: What|Removed |Added CC|

Re: Challenge

2016-10-03 Thread Manu via Digitalmars-d
I'm finding this rather annoying: struct S { static @property int p() { return 10; } } pragma(msg, typeof()); // prints: int function() @property pragma(msg, is(typeof() == function)); // prints: false It looks like a function... but I can't identify it as a function!

Re: Why using wrappers for D?

2016-10-03 Thread rikki cattermole via Digitalmars-d-learn
On 04/10/2016 1:56 AM, Chalix wrote: On Monday, 3 October 2016 at 12:15:10 UTC, rikki cattermole wrote: To use any kind of function you must declare it, plain and simple. Any c or c++ function/class is the very much same way. Now C++ types such as classes are highly limited in D since it

Re: PowerNex - The Userspace update! (also first birthday)

2016-10-03 Thread Philippe Back via Digitalmars-d-announce
On Sunday, 2 October 2016 at 22:58:31 UTC, WebFreak001 wrote: On Sunday, 2 October 2016 at 22:46:17 UTC, Wild wrote: [...] Awesome! Also here are some screenshots of the new release: https://i.webfreak.org/fLxJY8 https://i.webfreak.org/fLxrPH Kudos to you. I need to try this. Mh, do we

Challenge

2016-10-03 Thread Manu via Digitalmars-d
Fill in the blank... I'm having a really hard time with this. I've made it work with a mountain of code, and I want to see what others come up with... If you succeed, put it in std.traits! Recommend, use latest DMD nightly. I find differences with latest nightly vs release.

[Issue 16536] DMD master does not build on OS X 10.11.6/Xcode 7.3.1

2016-10-03 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16536 Steven Schveighoffer changed: What|Removed |Added CC|

Re: Why using wrappers for D?

2016-10-03 Thread Chalix via Digitalmars-d-learn
On Monday, 3 October 2016 at 12:54:03 UTC, Adam D. Ruppe wrote: It is possible, you just need to match compilers with the library in C++, whereas C libraries don't need such an exact match. With your Qt library, you get a build of it that is compatible with the compiler you use to build your

Re: Why using wrappers for D?

2016-10-03 Thread Chalix via Digitalmars-d-learn
On Monday, 3 October 2016 at 12:15:10 UTC, rikki cattermole wrote: To use any kind of function you must declare it, plain and simple. Any c or c++ function/class is the very much same way. Now C++ types such as classes are highly limited in D since it doesn't ugh cross over all that well (it

Re: Why using wrappers for D?

2016-10-03 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 3 October 2016 at 12:47:48 UTC, Chalix wrote: I read a bit about creating libraries in C++, and I found out, this is not possible, because there is no definition of the API. It is possible, you just need to match compilers with the library in C++, whereas C libraries don't need

Re: debugging mixins

2016-10-03 Thread Andrei Alexandrescu via Digitalmars-d
On 10/03/2016 07:42 AM, Stefan Koch wrote: On Sunday, 2 October 2016 at 12:27:23 UTC, Andrei Alexandrescu wrote: Yes, Stefan it would be terrific if you could keep an eye on it while working on the engine. A file with properly handed dependencies could serve as instantiation cache and save a

Re: ndslice: feature deprecation voting / discussion

2016-10-03 Thread Andrei Alexandrescu via Digitalmars-d
On 10/02/2016 11:01 PM, Manu via Digitalmars-d wrote: Ah, the 'sufficiently high-quality compiler' unicorn. It's been a legend in C++ for at least 20 years that I've been looking... For this particular matter it's somewhat of a solved problem in C++. Is it your perception as well that

Re: Why using wrappers for D?

2016-10-03 Thread Chalix via Digitalmars-d-learn
On Monday, 3 October 2016 at 12:12:44 UTC, Adam D. Ruppe wrote: A lot of people like the wrappers as being prettier to use since you can turn C functions into classes and such. gtkd is an example of that. Thanks for your fast answers :) Hm, I thing I am missing some fundamentals... I read a

Re: Why using wrappers for D?

2016-10-03 Thread cym13 via Digitalmars-d-learn
On Monday, 3 October 2016 at 12:08:54 UTC, Chalix wrote: Hi All! The documentation of D (https://dlang.org/overview.html#compatibility) says: "Direct Access to C API's Not only does D have data types that correspond to C types, it provides direct access to C functions. There is no need to

Re: Why using wrappers for D?

2016-10-03 Thread rikki cattermole via Digitalmars-d-learn
On 04/10/2016 1:08 AM, Chalix wrote: Hi All! The documentation of D (https://dlang.org/overview.html#compatibility) says: "Direct Access to C API's Not only does D have data types that correspond to C types, it provides direct access to C functions. There is no need to write wrapper

Re: Why using wrappers for D?

2016-10-03 Thread Adam D. Ruppe via Digitalmars-d-learn
On Monday, 3 October 2016 at 12:08:54 UTC, Chalix wrote: So, if there is no need for wrapper functions, why are there a lot of them? A lot of people like the wrappers as being prettier to use since you can turn C functions into classes and such. gtkd is an example of that. Furthermore, if

Why using wrappers for D?

2016-10-03 Thread Chalix via Digitalmars-d-learn
Hi All! The documentation of D (https://dlang.org/overview.html#compatibility) says: "Direct Access to C API's Not only does D have data types that correspond to C types, it provides direct access to C functions. There is no need to write wrapper functions, parameter swizzlers, nor code to

Re: debugging mixins

2016-10-03 Thread Ethan Watson via Digitalmars-d
On Monday, 3 October 2016 at 11:42:25 UTC, Stefan Koch wrote: @Ethan can you share code illustrating your usecase. (My head is inside compiler internals and building test-code is a rather unpleasant context switch) You should be able to do everything with the example code you have. My

Re: Getting GtkD working with OpenGL

2016-10-03 Thread Chalix via Digitalmars-d-learn
On Sunday, 18 September 2016 at 21:41:45 UTC, Mike Wey wrote: The demo still uses the old GtkGLExt binding, which usually isn't available in de distributions repositories. The newer GLArea is easier to use since it's part of GTK. As for the linker errors, you'll need to link with the OpenGL

Re: Beta 2.072.0-b1

2016-10-03 Thread Martin Nowak via Digitalmars-d-announce
On Sunday, 2 October 2016 at 15:36:58 UTC, Jacob Carlborg wrote: I think it could be more clear why it's deprecated and what to do instead: Language construct A is deprecated. A is bad because: ... Do this instead: ... Yes agreed, will try to establish a more formal format.

Re: bug, or is this also intended?

2016-10-03 Thread ag0aep6g via Digitalmars-d-learn
On 10/03/2016 01:40 PM, deed wrote: Unexpected auto-concatenation of string elements: string[] arr = ["a", "b" "c"];// ["a", "bc"], length==2 int[] arr2 = [[1], [2] [3]];// Error: array index 3 is out of bounds [2][0 .. 1] // Error: array index 3 is

  1   2   >