Re: Problem with using readln.

2017-04-29 Thread Andrew Edwards via Digitalmars-d-learn
On Sunday, 30 April 2017 at 03:20:20 UTC, JV wrote: On Sunday, 30 April 2017 at 03:18:04 UTC, Adam D. Ruppe wrote: On Sunday, 30 April 2017 at 03:10:25 UTC, JV wrote: btw i forgot to add () at readln while editing the post That's not necessary, it doesn't change anything. But readln without

alloca without runtime?

2017-04-29 Thread 岩倉 澪 via Digitalmars-d-learn
I've been playing around with using D with no runtime on Linux, but recently I was thinking it would be nice to have an alloca implementation. I was thinking I could just bump the stack pointer (with alignment considerations) but from what I understand compilers sometimes generate code that

[Issue 14402] std.conv.emplace segfaults for nested class

2017-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=14402 Walter Bright changed: What|Removed |Added Keywords||ice

Re: Problem with using readln.

2017-04-29 Thread JV via Digitalmars-d-learn
On Sunday, 30 April 2017 at 03:18:39 UTC, JV wrote: On Sunday, 30 April 2017 at 03:13:14 UTC, JV wrote: On Sunday, 30 April 2017 at 02:07:48 UTC, JV wrote: int func; writeln("\t\tEnter Selection : "); readln(func);

Re: Problem with using readln.

2017-04-29 Thread JV via Digitalmars-d-learn
On Sunday, 30 April 2017 at 03:20:20 UTC, JV wrote: On Sunday, 30 April 2017 at 03:18:04 UTC, Adam D. Ruppe wrote: On Sunday, 30 April 2017 at 03:10:25 UTC, JV wrote: okay?? but how do i return an int? tried using what i found in the internet like using std.conv; to use toInt() but still

Re: Problem with using readln.

2017-04-29 Thread JV via Digitalmars-d-learn
On Sunday, 30 April 2017 at 03:18:04 UTC, Adam D. Ruppe wrote: On Sunday, 30 April 2017 at 03:10:25 UTC, JV wrote: btw i forgot to add () at readln while editing the post That's not necessary, it doesn't change anything. But readln without arguments returns a string, not an int. okay?? but

Re: Problem with using readln.

2017-04-29 Thread JV via Digitalmars-d-learn
On Sunday, 30 April 2017 at 03:13:14 UTC, JV wrote: On Sunday, 30 April 2017 at 02:07:48 UTC, JV wrote: Hello i'm kinda new to D language and i wanted to make a simple program but somehow my input does no go to my if statements and just continues to ask for the user to input.Kindly help me

Re: Problem with using readln.

2017-04-29 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 30 April 2017 at 03:10:25 UTC, JV wrote: btw i forgot to add () at readln while editing the post That's not necessary, it doesn't change anything. But readln without arguments returns a string, not an int.

Re: Problem with using readln.

2017-04-29 Thread JV via Digitalmars-d-learn
On Sunday, 30 April 2017 at 02:07:48 UTC, JV wrote: Hello i'm kinda new to D language and i wanted to make a simple program but somehow my input does no go to my if statements and just continues to ask for the user to input.Kindly help me btw here is my sample code int func;

Re: Problem with using readln.

2017-04-29 Thread JV via Digitalmars-d-learn
On Sunday, 30 April 2017 at 03:04:49 UTC, Adam D. Ruppe wrote: On Sunday, 30 April 2017 at 02:07:48 UTC, JV wrote: int func; writeln("\t\tEnter Selection : "); func = readln; writeln(func); That shouldn't even compile... are you sure that's your actual code, and that it is

Re: "Competitive Advantage with D" is one of the keynotes at C++Now 2017

2017-04-29 Thread Adam D. Ruppe via Digitalmars-d-announce
On Saturday, 29 April 2017 at 14:13:18 UTC, Patrick Schluter wrote: For the same reason it is in C. If the ambition for D is to be a system language then it should avoid introducing artificial abstractions and work with the machine it runs on, not against. The C model isn't much like x86 at

Re: Problem with using readln.

2017-04-29 Thread Adam D. Ruppe via Digitalmars-d-learn
On Sunday, 30 April 2017 at 02:07:48 UTC, JV wrote: int func; writeln("\t\tEnter Selection : "); func = readln; writeln(func); That shouldn't even compile... are you sure that's your actual code, and that it is actually building successfully?

Re: alias can't find symbol or can't use symbol

2017-04-29 Thread bauss via Digitalmars-d-learn
On Sunday, 30 April 2017 at 00:17:37 UTC, Carl Sturtivant wrote: Consider the following. struct member { int n; } struct outer { member x; alias x this; alias n2 = n; } This does not compile: alias n2 = n; Error: undefined identifier 'n' On the other hand if change that into

Problem with using readln.

2017-04-29 Thread JV via Digitalmars-d-learn
Hello i'm kinda new to D language and i wanted to make a simple program but somehow my input does no go to my if statements and just continues to ask for the user to input.Kindly help me btw here is my sample code int func; writeln("\t\tEnter Selection : "); func = readln;

test

2017-04-29 Thread jimdoc via Digitalmars-d
// Round floating point numbers import std.algorithm, std.conv, std.functional, std.math, std.regex, std.stdio; alias round = pipe!(to!real, std.math.round, to!string); static reFloatingPoint = ctRegex!`[0-9]+\.[0-9]+`; void main() { // Replace anything that looks like a real //

Re: List of major changes in D since 2010?

2017-04-29 Thread H. S. Teoh via Digitalmars-d
On Sat, Apr 29, 2017 at 09:45:36PM +, Ichneumwn via Digitalmars-d wrote: > Hi, > > I use Andrei Alexandrescu's "The D Programming Language" as my main > reference for the D language. I was wondering if there is a list of > major developments/changes to D since the 2010 publication of the >

Re: interfacing Cpp - GCC Dual ABI abi_tag in name mangling

2017-04-29 Thread via Digitalmars-d-learn
On Saturday, 29 April 2017 at 19:16:14 UTC, kinke wrote: On Saturday, 29 April 2017 at 18:08:16 UTC, سليمان السهمي (Soulaïman Sahmi) wrote: GCC has this attribute called abi_tag that they put on any function that returns std::string or std::list The usual workaround is compiling the C++

alias can't find symbol or can't use symbol

2017-04-29 Thread Carl Sturtivant via Digitalmars-d-learn
Consider the following. struct member { int n; } struct outer { member x; alias x this; alias n2 = n; } This does not compile: alias n2 = n; Error: undefined identifier 'n' On the other hand if change that into alias n2 = x.n; then it does compile. void main() { outer

Re: multiple `alias this` suggestion

2017-04-29 Thread Carl Sturtivant via Digitalmars-d
On Thursday, 27 April 2017 at 05:41:43 UTC, Daniel N wrote: On Wednesday, 26 April 2017 at 18:34:48 UTC, Carl Sturtivant wrote: On Wednesday, 26 April 2017 at 15:00:30 UTC, Steven Image using frameworks which conveniently allow adding features to a struct... struct Beholder { mixin

Re: multiple `alias this` suggestion

2017-04-29 Thread Carl Sturtivant via Digitalmars-d
On Friday, 21 April 2017 at 14:55:31 UTC, Steven Schveighoffer wrote: One thing we can do also is just use declaration order to prioritize which alias this to use. Presumably using declaration order as a means of prioritizing which name wins was rejected as a design possibility in the case

Re: multiple `alias this` suggestion

2017-04-29 Thread Carl Sturtivant via Digitalmars-d
On Friday, 28 April 2017 at 07:07:44 UTC, Daniel N wrote: On Friday, 28 April 2017 at 05:32:36 UTC, Carl Sturtivant wrote: On Friday, 28 April 2017 at 04:44:44 UTC, Carl Sturtivant wrote: On Thursday, 27 April 2017 at 05:41:43 UTC, Daniel N wrote: On Wednesday, 26 April 2017 at 18:34:48 UTC,

Re: multiple `alias this` suggestion

2017-04-29 Thread Carl Sturtivant via Digitalmars-d
On Thursday, 27 April 2017 at 05:41:43 UTC, Daniel N wrote: On Wednesday, 26 April 2017 at 18:34:48 UTC, Carl Sturtivant wrote: On Wednesday, 26 April 2017 at 15:00:30 UTC, Steven Schveighoffer wrote: I think you can appreciate that this doesn't scale. Imagine a case which has 2 or 3 optional

List of major changes in D since 2010?

2017-04-29 Thread Ichneumwn via Digitalmars-d
Hi, I use Andrei Alexandrescu's "The D Programming Language" as my main reference for the D language. I was wondering if there is a list of major developments/changes to D since the 2010 publication of the book? Just the language itself, not the libraries/packages. The information will be

Re: User input; quick question.

2017-04-29 Thread fred via Digitalmars-d-learn
On Saturday, 29 April 2017 at 21:18:27 UTC, cym13 wrote: On Saturday, 29 April 2017 at 21:09:13 UTC, fred wrote: import std.stdio; I am somewhat new to D, and I am trying to receive user input, like this, with a prompt: string str; writeln("Enter a string: "); str = readln; writeln(str);

Re: User input; quick question.

2017-04-29 Thread cym13 via Digitalmars-d-learn
On Saturday, 29 April 2017 at 21:09:13 UTC, fred wrote: import std.stdio; I am somewhat new to D, and I am trying to receive user input, like this, with a prompt: string str; writeln("Enter a string: "); str = readln; writeln(str); However, the prompt appears after I enter the input; any

User input; quick question.

2017-04-29 Thread fred via Digitalmars-d-learn
import std.stdio; I am somewhat new to D, and I am trying to receive user input, like this, with a prompt: string str; writeln("Enter a string: "); str = readln; writeln(str); However, the prompt appears after I enter the input; any reason why? I've trawled the internet for a good hour,

Re: DConf 2017 Berlin - Streaming ?

2017-04-29 Thread Andrej Mitrovic via Digitalmars-d
On Saturday, 29 April 2017 at 17:58:15 UTC, Joakim wrote: Any update on the stream this year, for those of us planning to watch the talks remotely? The last bit of news I've received is they will be streamed on youtube this time.

Re: C++ Interfacing:'static' array function parameter contradiction

2017-04-29 Thread kinke via Digitalmars-d-learn
On Saturday, 29 April 2017 at 18:54:36 UTC, سليمان السهمي (Soulaïman Sahmi) wrote: But still, this needs to be fixed, copy pasting the name mangling is in my opinion just a hack for your specific cpp compiler on your specific platform. It can't be fixed on the D side as the Visual C++

Re: interfacing Cpp - GCC Dual ABI abi_tag in name mangling

2017-04-29 Thread kinke via Digitalmars-d-learn
On Saturday, 29 April 2017 at 18:08:16 UTC, سليمان السهمي (Soulaïman Sahmi) wrote: GCC has this attribute called abi_tag that they put on any function that returns std::string or std::list The usual workaround is compiling the C++ source with _GLIBCXX_USE_CXX11_ABI=0 for gcc >= 5.

Re: C++ Interfacing:'static' array function parameter contradiction

2017-04-29 Thread via Digitalmars-d-learn
On Saturday, 29 April 2017 at 08:08:27 UTC, ParticlePeter wrote: On Saturday, 29 April 2017 at 00:31:32 UTC, Nicholas Wilson wrote: If you are having problems with the linker with Ali's you can do ``` extern(C++) bool cppFunc( float[3] color ); // correct signature, but causes compiler

interfacing Cpp - GCC Dual ABI abi_tag in name mangling

2017-04-29 Thread via Digitalmars-d-learn
GCC has this attribute called abi_tag that they put on any function that returns std::string or std::list, for the rational behind that read here:https://gcc.gnu.org/onlinedocs/libstdc++/manual/using_dual_abi.html . the special thing with this attribute is that it adds something to the name

Re: DConf 2017 Berlin - Streaming ?

2017-04-29 Thread Joakim via Digitalmars-d
On Saturday, 15 April 2017 at 07:23:10 UTC, Joakim wrote: On Saturday, 15 April 2017 at 07:15:06 UTC, Nick B wrote: Hi Can anyone advise if there will be live streaming or will there only YouTube videos after the event. Not that I'm complaining. thanks Nick They had it on Ustream last

Re: CTFE Status 2

2017-04-29 Thread Stefan Koch via Digitalmars-d
On Friday, 28 April 2017 at 17:53:04 UTC, Stefan Koch wrote: On Thursday, 16 February 2017 at 21:05:51 UTC, Stefan Koch wrote: [ ... ] Hi Guys, I just implemented sliceAssigment. meaning the following code will now compile: uint[] assignSlice(uint from, uint to, uint[] stuff) { uint[]

Re: CTFE Status 2

2017-04-29 Thread Stefan Koch via Digitalmars-d
On Friday, 28 April 2017 at 08:47:43 UTC, Stefan Koch wrote: On Thursday, 16 February 2017 at 21:05:51 UTC, Stefan Koch wrote: [ ... ] After a little of exploration of the JIT, I have now determined that a simple risc architecture is still the best. (codegen for scaled loads is hard :p) I

Re: "Competitive Advantage with D" is one of the keynotes at C++Now 2017

2017-04-29 Thread H. S. Teoh via Digitalmars-d-announce
On Sat, Apr 29, 2017 at 11:24:36AM +, Patrick Schluter via Digitalmars-d-announce wrote: > On Friday, 28 April 2017 at 22:11:30 UTC, H. S. Teoh wrote: > > The latest WAT I found in D is this one, see if you can figure it > > out: > > > > char ch; > > wchar wch; > > dchar dch; > >

[Issue 17351] Static const array can't be evaluated at compile time when passed as ref argument

2017-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17351 --- Comment #8 from ag0ae...@gmail.com --- (In reply to Andrei Alexandrescu from comment #6) > Now, Lucia (@somzzz) has gotten to the point where it all passes druntime > and phobos unittests, but breaks in exactly one point in the compiler. It > can

Re: "Competitive Advantage with D" is one of the keynotes at C++Now 2017

2017-04-29 Thread Ola Fosheim Grøstad via Digitalmars-d-announce
On Saturday, 29 April 2017 at 14:13:18 UTC, Patrick Schluter wrote: That's not a simple assumption, it's acknowledgment that a C program runs on real hardware not a virtual machine like Java or C#. Modern X86s are basically virtual machines... The instruction set is decoded and executed on a

Re: DWT fails to build with DMD 2.074.0

2017-04-29 Thread JamesD via Digitalmars-d-dwt
On Saturday, 29 April 2017 at 13:54:04 UTC, Petar Kirov [ZombineDev] wrote: Are the *.di generated automatically, or are they written by hand? The compiler is known [0] to have problems with header (*.di) generation, and IIRC there were some fixes recently [1] that may have caused this

Re: "Competitive Advantage with D" is one of the keynotes at C++Now 2017

2017-04-29 Thread Patrick Schluter via Digitalmars-d-announce
On Saturday, 29 April 2017 at 11:48:46 UTC, Ola Fosheim Grøstad wrote: On Saturday, 29 April 2017 at 11:24:36 UTC, Patrick Schluter wrote: C99 says "if an int can represent all values of the original type, the value is converted to an int; otherwise, it is converted to an unsigned int."

[Issue 17141] Type Inference Incorrectly Converts Characters to Integers

2017-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17141 Jack Stouffer changed: What|Removed |Added Summary|CommonType!(dchar, char)|Type Inference

[Issue 17351] Static const array can't be evaluated at compile time when passed as ref argument

2017-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17351 ZombineDev changed: What|Removed |Added CC|

[Issue 17141] CommonType!(dchar, char) returns uint

2017-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17141 Jack Stouffer changed: What|Removed |Added Blocks||17358 --

[Issue 17358] [REG 2.074.0] std.stdio.File.lockingTextWriter.put no longer accepts chains of characters

2017-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17358 Jack Stouffer changed: What|Removed |Added Depends on||17141 --

Re: DWT fails to build with DMD 2.074.0

2017-04-29 Thread via Digitalmars-d-dwt
On Saturday, 29 April 2017 at 12:42:09 UTC, JamesD wrote: Is there a known issue with DMD 2.074.0 importing *.di files? (If no answer here, I will re-post in the DMD thread) I've searched, but could not find this issue in the forums. The following errors occur on both linux and windows when

[Issue 17351] Static const array can't be evaluated at compile time when passed as ref argument

2017-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17351 --- Comment #7 from Andrei Alexandrescu --- I meant: bool __equals(L, R)(L[] lhs, R[] rhs); bool __equals(L, R, size_t n1)(auto ref L[n1] lhs, R[] rhs); bool __equals(L, R, size_t n2)(auto ref L[] lhs, auto ref R[n2] rhs); bool

[Issue 17351] Static const array can't be evaluated at compile time when passed as ref argument

2017-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17351 --- Comment #6 from Andrei Alexandrescu --- (In reply to ag0aep6g from comment #5) > You have to initialize the int[3], as you did with the int. I suppose the > compiler assumes that you're going to do run-time initialization via

What's the rationale behind partial initialization of static arrays ?

2017-04-29 Thread Basile B. via Digitalmars-d
I'd like to know why the things work like they are working now: === module a; immutable int[42] a = [42]; // OK static immutable int[42] b = [42]; // OK void main() { immutable int[42] c = [42]; // Not allowed } === 1/ this is error prone 2/ the semantic is not consistent (allowed here,

DWT fails to build with DMD 2.074.0

2017-04-29 Thread JamesD via Digitalmars-d-dwt
Is there a known issue with DMD 2.074.0 importing *.di files? (If no answer here, I will re-post in the DMD thread) I've searched, but could not find this issue in the forums. The following errors occur on both linux and windows when building a simple hello world DWT gui app. The same code

Re: "Competitive Advantage with D" is one of the keynotes at C++Now 2017

2017-04-29 Thread Ola Fosheim Grøstad via Digitalmars-d-announce
On Saturday, 29 April 2017 at 11:24:36 UTC, Patrick Schluter wrote: C99 says "if an int can represent all values of the original type, the value is converted to an int; otherwise, it is converted to an unsigned int." Well, C is making the simple assumption that registers are int-sized...

Re: C++ Interfacing:'static' array function parameter contradiction

2017-04-29 Thread ParticlePeter via Digitalmars-d-learn
On Saturday, 29 April 2017 at 10:17:47 UTC, Atila Neves wrote: On Saturday, 29 April 2017 at 06:22:03 UTC, ParticlePeter wrote: On Saturday, 29 April 2017 at 01:49:56 UTC, Atila Neves wrote: On Friday, 28 April 2017 at 18:41:22 UTC, kinke wrote: [...] The worst part about that is mangling

Re: "Competitive Advantage with D" is one of the keynotes at C++Now 2017

2017-04-29 Thread Patrick Schluter via Digitalmars-d-announce
On Friday, 28 April 2017 at 22:11:30 UTC, H. S. Teoh wrote: The latest WAT I found in D is this one, see if you can figure it out: char ch; wchar wch; dchar dch; pragma(msg, typeof(true ? ch : ch));// char - OK pragma(msg, typeof(true ? ch : wch));

Re: Visual Programming: NoFlo and Flow-based Programming

2017-04-29 Thread davidvm via Digitalmars-d
Thank you guys for your input.

Re: Garbage Collector?

2017-04-29 Thread Ola Fosheim Grøstad via Digitalmars-d
On Saturday, 29 April 2017 at 10:54:02 UTC, bachmeier wrote: Many invested in Rust and C++ will look for arguments to support staying with their language. I've come to the conclusion that the D community is mostly to blame for not making a good case to the other group that are open to D, but

Re: Garbage Collector?

2017-04-29 Thread bachmeier via Digitalmars-d
On Friday, 28 April 2017 at 19:49:35 UTC, Ola Fosheim Grøstad wrote: On Friday, 28 April 2017 at 17:48:47 UTC, Ola Fosheim Grøstad wrote: On Friday, 28 April 2017 at 17:42:18 UTC, bachmeier wrote: I'm hoping to put all information in one place. Then when someone on Reddit or HN or here starts

Re: C++ Interfacing:'static' array function parameter contradiction

2017-04-29 Thread Atila Neves via Digitalmars-d-learn
On Saturday, 29 April 2017 at 06:22:03 UTC, ParticlePeter wrote: On Saturday, 29 April 2017 at 01:49:56 UTC, Atila Neves wrote: On Friday, 28 April 2017 at 18:41:22 UTC, kinke wrote: [...] The worst part about that is mangling aside, the two declarations are identical to the compiler.

Re: Garbage Collector?

2017-04-29 Thread Moritz Maxeiner via Digitalmars-d
On Saturday, 29 April 2017 at 09:24:35 UTC, Ola Fosheim Grøstad wrote: On Saturday, 29 April 2017 at 08:45:26 UTC, Moritz Maxeiner wrote: On Saturday, 29 April 2017 at 07:26:45 UTC, Timon Gehr wrote: I don't doubt that, but the implicit generalization is "multiple pointer types are necessarily

[Issue 17359] C++ Interfacing: function with 'static' array parameter cannot be linked (x64)

2017-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17359 --- Comment #3 from ki...@gmx.net --- So the proper workaround for MSVC targets would be: C++: bool cppFunc(float color[3]) { for (int i = 0; i < 3; ++i) color[i] *= 2; return true; } D: pragma(mangle, "?cppFunc@@YA_NQEAM@Z") extern(C++)

Re: DConf Hackathon Ideas

2017-04-29 Thread Daniel N via Digitalmars-d
On Thursday, 27 April 2017 at 14:53:02 UTC, Mike Parker wrote: This year, DConf has an extra day tacked on for problem solving in the form of a hackathon. The intent is to work on issues people find frustrating in the D ecosystem. While there will be time given at the event for proposals, and

[Issue 17359] C++ Interfacing: function with 'static' array parameter cannot be linked (x64)

2017-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17359 ki...@gmx.net changed: What|Removed |Added CC||ki...@gmx.net --- Comment #2 from

Re: Garbage Collector?

2017-04-29 Thread Ola Fosheim Grøstad via Digitalmars-d
On Saturday, 29 April 2017 at 08:45:26 UTC, Moritz Maxeiner wrote: On Saturday, 29 April 2017 at 07:26:45 UTC, Timon Gehr wrote: I don't doubt that, but the implicit generalization is "multiple pointer types are necessarily always a royal PITA". The "implicit generalization" is your

Re: "Competitive Advantage with D" is one of the keynotes at C++Now 2017

2017-04-29 Thread Ola Fosheim Grøstad via Digitalmars-d-announce
On Saturday, 29 April 2017 at 03:44:50 UTC, Nick Sabalausky (Abscissa) wrote: On 04/28/2017 06:11 PM, H. S. Teoh via Digitalmars-d-announce wrote: https://bartoszmilewski.com/2013/09/19/edward-chands/ That is *awesome*! Although, I always saw Eddie Scissors as more of a retelling of

Re: problem with std.variant rounding

2017-04-29 Thread via Digitalmars-d-learn
On Friday, 28 April 2017 at 18:08:38 UTC, H. S. Teoh wrote: On Fri, Apr 28, 2017 at 04:42:28PM +, via Digitalmars-d-learn wrote: [...] writefln(text("%.", i, "f"), x); [...] There's no need to use text() here: writefln("%.*f", i, x); does what you want. T Thanks, I

Re: get parameters of a function

2017-04-29 Thread Alex via Digitalmars-d-learn
On Saturday, 29 April 2017 at 08:15:06 UTC, Stanislav Blinov wrote: Ah, that calls for something like a isCallableWith template. Pay extra care to how you pass parameters in that variadic opCall template though. Doing it like in the code above will pass everything by value, even though the

Re: Garbage Collector?

2017-04-29 Thread Moritz Maxeiner via Digitalmars-d
On Saturday, 29 April 2017 at 07:26:45 UTC, Timon Gehr wrote: On 28.04.2017 23:52, H. S. Teoh via Digitalmars-d wrote: On Fri, Apr 28, 2017 at 09:50:49PM +, Atila Neves via Digitalmars-d wrote: On Friday, 28 April 2017 at 19:41:15 UTC, Ola Fosheim Grøstad wrote: On Friday, 28 April 2017 at

Re: Garbage Collector?

2017-04-29 Thread Moritz Maxeiner via Digitalmars-d
On Saturday, 29 April 2017 at 07:15:36 UTC, Timon Gehr wrote: On 28.04.2017 17:43, Moritz Maxeiner wrote: [...] No. Every single thread I read in the last couple of years ended with Walter pointing out issues that need to be "hashed out" and then nobody doing it. This is not the full

Re: get parameters of a function

2017-04-29 Thread Stanislav Blinov via Digitalmars-d-learn
On Saturday, 29 April 2017 at 06:18:34 UTC, Alex wrote: The problem is another one: say I have something like this: import std.traits; struct A(alias T) if(isCallable!T) { auto opCall(U...)(U args) if(is(Parameters!T == U)) //if(__traits(compiles, T(args))) {

Re: C++ Interfacing:'static' array function parameter contradiction

2017-04-29 Thread ParticlePeter via Digitalmars-d-learn
On Saturday, 29 April 2017 at 00:31:32 UTC, Nicholas Wilson wrote: If you are having problems with the linker with Ali's you can do ``` extern(C++) bool cppFunc( float[3] color ); // correct signature, but causes compiler error pragma(mangle, cppFunc.mangleof) float cppFunc(float * color);

Re: Garbage Collector?

2017-04-29 Thread Ola Fosheim Grøstad via Digitalmars-d
On Saturday, 29 April 2017 at 07:26:45 UTC, Timon Gehr wrote: I don't doubt that, but the implicit generalization is "multiple pointer types are necessarily always a royal PITA". Not true. scope has worse usability than a scoped pointer type. Yes. In this context it is was more about the GC

[Issue 17359] C++ Interfacing: function with 'static' array parameter cannot be linked (x64)

2017-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17359 --- Comment #1 from Peter Particle --- As a work around, we can use Ali's variant and pragma(mangle, "mangle_string"). I found my "mangle_string" with dependency walker. --

Re: Garbage Collector?

2017-04-29 Thread Timon Gehr via Digitalmars-d
On 28.04.2017 23:52, H. S. Teoh via Digitalmars-d wrote: On Fri, Apr 28, 2017 at 09:50:49PM +, Atila Neves via Digitalmars-d wrote: On Friday, 28 April 2017 at 19:41:15 UTC, Ola Fosheim Grøstad wrote: On Friday, 28 April 2017 at 19:41:15 UTC, Ola Fosheim Grøstad wrote: «Back in the old DOS

Re: Garbage Collector?

2017-04-29 Thread Timon Gehr via Digitalmars-d
On 28.04.2017 17:43, Moritz Maxeiner wrote: On Friday, 28 April 2017 at 14:59:46 UTC, Ola Fosheim Grøstad wrote: On Friday, 28 April 2017 at 09:40:07 UTC, Moritz Maxeiner wrote: I'm sorry, but that's just plain wrong. D does not have ownership pointers because nobody that wants them has

[Issue 17355] Path to lib64 and $(DMDInstallDir) not correct

2017-04-29 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17355 --- Comment #4 from Rainer Schuetze --- HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\VisualD is where the installer remembers the setting made during installation. For each Visual Studio version that you choose for Vsiual D

Re: C++ Interfacing:'static' array function parameter contradiction

2017-04-29 Thread ParticlePeter via Digitalmars-d-learn
On Saturday, 29 April 2017 at 01:49:56 UTC, Atila Neves wrote: On Friday, 28 April 2017 at 18:41:22 UTC, kinke wrote: On Friday, 28 April 2017 at 18:07:49 UTC, ParticlePeter wrote: Interesting, your example corresponds to my third case, the linker error. I am on Window, building an x64 App,

Re: get parameters of a function

2017-04-29 Thread Alex via Digitalmars-d-learn
On Saturday, 29 April 2017 at 05:58:35 UTC, Stanislav Blinov wrote: On Friday, 28 April 2017 at 20:43:50 UTC, Alex wrote: void main() { foreach(o1; __traits(getOverloads, S1, "opCall")) { alias P1 = Parameters!o1; foreach(o2; __traits(getOverloads, S2, "opCall"))

Re: get parameters of a function

2017-04-29 Thread Stanislav Blinov via Digitalmars-d-learn
On Friday, 28 April 2017 at 20:43:50 UTC, Alex wrote: Hi all, I have a question about the Parameters trait from https://dlang.org/phobos/std_traits.html#Parameters The following code does not compile. Why? Is it mainly assumed to use it with functions without overloads? Rather, it is to be