Re: Ncurses deprecated ~master issue

2015-02-11 Thread Paul via Digitalmars-d-learn
On Tuesday, 10 February 2015 at 23:39:56 UTC, Adam D. Ruppe wrote: On Tuesday, 10 February 2015 at 21:11:14 UTC, Paul wrote: Yes, I noted the default values, even if I don't understand what they do at present(!). They allow overriding of the input/output files. fdIn normally refers to

Comparing function pointers

2015-02-11 Thread Freddy via Digitalmars-d-learn
import std.stdio; auto test1(){ void testFunc(){ } return testFunc; } auto test2(){ uint a; void testFunc(){ a=1; } return testFunc; } void main(){ writeln(test1()==test1());//true

Re: Ncurses deprecated ~master issue

2015-02-11 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 11 February 2015 at 18:13:10 UTC, Paul wrote: How do I get/process input? Construct the real time input struct outside your loop then use getch if you're only interested in the core keyboard ascii stuff or nextEvent if you want everything. The esc key, in particular, is

Re: Comparing function pointers

2015-02-11 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 11 February 2015 at 18:40:05 UTC, Freddy wrote: Is the intended behavior? Yes. test2 returns a delegate that closes over a separate copy of the local variable, so the data pointer is different each time. You can get the two pointers with .funcptr and .ptr. You'll find

Re: Comparing function pointers

2015-02-11 Thread ketmar via Digitalmars-d-learn
On Wed, 11 Feb 2015 18:40:03 +, Freddy wrote: import std.stdio; auto test1(){ void testFunc(){ } return testFunc; } auto test2(){ uint a; void testFunc(){ a=1; } return testFunc; } void main(){

Re: Ncurses deprecated ~master issue

2015-02-11 Thread Paul via Digitalmars-d-learn
On Wednesday, 11 February 2015 at 18:37:49 UTC, Adam D. Ruppe wrote: On Wednesday, 11 February 2015 at 18:13:10 UTC, Paul wrote: How do I get/process input? Construct the real time input struct outside your loop then use getch if you're only interested in the core keyboard ascii stuff or

Re: Why is one d file compiled into two files object file executable.

2015-02-11 Thread Kagamin via Digitalmars-d-learn
On Wednesday, 11 February 2015 at 08:49:40 UTC, Andre Artus wrote: First to mind is that in Java .class files are executable (in Java runtime), while object files are not. There was a library, which could load object files with D code, resolve symbols and execute it.

Re: Why is one d file compiled into two files object file executable.

2015-02-11 Thread jklp via Digitalmars-d-learn
On Wednesday, 11 February 2015 at 05:08:16 UTC, Venkat Akkineni wrote: Hi I am coming from Java. What is the purpose of an object file why is it generated at compile time in addition to an executable. I know C generates an object file too, but I don't know what the use is. Please point me

Re: Why is one d file compiled into two files object file executable.

2015-02-11 Thread Kagamin via Digitalmars-d-learn
http://www.dsource.org/projects/ddl

Question about scope of @nogc

2015-02-11 Thread weaselcat via Digitalmars-d-learn
(Scope might have been a bad word choice...) Is @nogc intended to only stop from calling functions that allocate with the GC, or from interacting with the GC altogether? Is there a technical reason that functions such as addrange, etc cannot be @nogc if the former since AFAIK such functions

Re: GC has a barbaric destroyng model, I think

2015-02-11 Thread Orvid King via Digitalmars-d-learn
On Wednesday, 11 February 2015 at 21:34:00 UTC, Andrey Derzhavin wrote: If we are using a DMD realization of destroying of objects, happens the following: at the calling the «destroy» method the calling of dtor takes place always, and then the object which is being destroyed is

Re: GC has a barbaric destroyng model, I think

2015-02-11 Thread ketmar via Digitalmars-d-learn
On Wed, 11 Feb 2015 21:33:59 +, Andrey Derzhavin wrote: If we are using a DMD realization of destroying of objects, happens the following: at the calling the «destroy» method the calling of dtor takes place always, and then the object which is being destroyed is initialized by the

GC has a barbaric destroyng model, I think

2015-02-11 Thread Andrey Derzhavin via Digitalmars-d-learn
If we are using a DMD realization of destroying of objects, happens the following: at the calling the «destroy» method the calling of dtor takes place always, and then the object which is being destroyed is initialized by the default state. In other words, after calling «destroy»

Re: Cannot use the same template arguments on function as the ones on struct

2015-02-11 Thread anonymous via Digitalmars-d-learn
On Wednesday, 11 February 2015 at 22:14:44 UTC, MrSmith wrote: http://dpaste.dzfl.pl/5f1d5d5d9e19 Instead I need to use template constraint which is less compact. http://dpaste.dzfl.pl/571ae84d783e Why such behavior happens? Seems to work when you add an empty template argument list to

Re: How to make a Currency class from std.BigInt?

2015-02-11 Thread RuZzz via Digitalmars-d-learn
https://github.com/acmeism/RosettaCodeData/blob/master/Task/Arithmetic-Rational/D/arithmetic-rational.d

Cannot use the same template arguments on function as the ones on struct

2015-02-11 Thread MrSmith via Digitalmars-d-learn
Here I have templated struct that matches type with CborConfig tempate specialization CborConfig will have more parameters in future and all of them will be accessed via alias members, so I've used variadic (T...) parameter whule matching. --- template

Re: How to make a Currency class from std.BigInt?

2015-02-11 Thread RuZzz via Digitalmars-d-learn
With eris lib some problems, the first error: .../.dub/packages/eris-0.0.1/eris/integer/digits.d(241): Error: cannot implicitly convert expression (digits.length) of type ulong to int What can I import to use rational numbers? I found it

Re: GC has a barbaric destroyng model, I think

2015-02-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Wednesday, February 11, 2015 21:40:30 Orvid King via Digitalmars-d-learn wrote: On Wednesday, 11 February 2015 at 21:34:00 UTC, Andrey Derzhavin wrote: If we are using a DMD realization of destroying of objects, happens the following: at the calling the «destroy» method the

Re: Cannot use the same template arguments on function as the ones on struct

2015-02-11 Thread Stefan Koch via Digitalmars-d-learn
DMD cannot overload templated and non-templated functions an empty template argument is needed

Re: Why is one d file compiled into two files object file executable.

2015-02-11 Thread Andre Artus via Digitalmars-d-learn
On Wednesday, 11 February 2015 at 07:42:31 UTC, Kagamin wrote: On Wednesday, 11 February 2015 at 05:08:16 UTC, Venkat Akkineni wrote: I am coming from Java. What is the purpose of an object file why is it generated at compile time in addition to an executable. I know C generates an object

Re: How to write asia characters on console?

2015-02-11 Thread Kagamin via Digitalmars-d-learn
https://issues.dlang.org/show_bug.cgi?id=2742

Re: How to write asia characters on console?

2015-02-11 Thread Andre Artus via Digitalmars-d-learn
On Sunday, 8 February 2015 at 05:56:22 UTC, Lave Zhang wrote: Hi, My first D program is like this: --- import std.stdio; void main(string[] args) { dstring s1 = hello你好d; writeln(s1); } --- But the output is not

Re: DUSE_MYLIB12

2015-02-11 Thread Dennis Ritchie via Digitalmars-d-learn
Thanks.

DUSE_MYLIB12

2015-02-11 Thread Dennis Ritchie via Digitalmars-d-learn
Tell me, please, is it possible to set an arbitrary condition conditional compilation at the command prompt, type DUSE_MYLIB12 and in the code as: version(USE_MYLIB12) { . } And I didn't like Any DeclarationBlock or Statement that is not compiled in still must be syntactically

Re: DUSE_MYLIB12

2015-02-11 Thread Vladimir Panteleev via Digitalmars-d-learn
On Wednesday, 11 February 2015 at 11:26:20 UTC, Dennis Ritchie wrote: Tell me, please, is it possible to set an arbitrary condition conditional compilation at the command prompt, type DUSE_MYLIB12 and in the code as: version(USE_MYLIB12) { . } Specify -version=USE_MYLIB12 on the

Re: Cannot use the same template arguments on function as the ones on struct

2015-02-11 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, February 12, 2015 07:11:12 Stefan Koch via Digitalmars-d-learn wrote: DMD cannot overload templated and non-templated functions an empty template argument is needed That's not actually true anymore. However, you have to be really careful when you do it, because it pretty much