Re: Copying and moving directories

2017-02-16 Thread Daniel Kozák via Digitalmars-d-learn
V Thu, 16 Feb 2017 16:38:51 + Chris via Digitalmars-d-learn napsáno: > In `std.file`, I haven't found a function that allows me to move > or at least copy directories, as in `mv dir /toDir`. Do I have to > go the awkward way over `rename` or something? http://forum.dlang.org/post/uzoxwrxsg

Re: User imput string int and float[DOUBT]

2017-02-16 Thread Jean Cesar via Digitalmars-d-learn
On Thursday, 16 February 2017 at 22:44:58 UTC, Ali Çehreli wrote: On 02/16/2017 02:05 PM, Jean Cesar wrote: > So I used get methods and sets only as initial pattern to netender the > functioning of the language in relation to some concepts of the same Makes sense... > how to leave a very small

Flat file CMS in D?

2017-02-16 Thread Faux Amis via Digitalmars-d-learn
I was wondering, what would be the D equivalent of a flat file (as opposed to database driven) content management system?

Re: isNumeric bugfix or 2.072 regression?

2017-02-16 Thread Johan Engelen via Digitalmars-d-learn
On Thursday, 16 February 2017 at 23:15:09 UTC, Johan Engelen wrote: Hi all, `isNumeric!string` no longer works like it did in 2.071 when both std.string and std.traits are imported. https://issues.dlang.org/show_bug.cgi?id=17190

isNumeric bugfix or 2.072 regression?

2017-02-16 Thread Johan Engelen via Digitalmars-d-learn
Hi all, `isNumeric!string` no longer works like it did in 2.071 when both std.string and std.traits are imported. This code no longer compiles with 2.072: ```d // RUN: dmd -c test.d import std.string; import std.traits; void foo() { static if (isNumeric!string) {} } ``` The error is (

Re: User imput string int and float[DOUBT]

2017-02-16 Thread Ali Çehreli via Digitalmars-d-learn
On 02/16/2017 02:05 PM, Jean Cesar wrote: > So I used get methods and sets only as initial pattern to netender the > functioning of the language in relation to some concepts of the same Makes sense... > how to leave a very small code with the largest number of > Possible functionality type I t

Re: User imput string int and float[DOUBT]

2017-02-16 Thread Jean Cesar via Digitalmars-d-learn
On Thursday, 16 February 2017 at 02:17:49 UTC, Ali Çehreli wrote: On 02/15/2017 05:49 PM, Jean Cesar wrote: > So I'm a beginner in this language and have very little time I started > I'm interested in apprehending concepts of object orientation > polymorphism inheritance, multiple inheritance as

Re: How to use D-language polymorphism?

2017-02-16 Thread Ali Çehreli via Digitalmars-d-learn
On 02/16/2017 11:09 AM, Jean Cesar wrote: > I have the following code in c++ using polymorphism how would I convert > D-language polymorphism? import std.stdio; class Mamifero { int idade; void somMamifero() { writeln("\n\tSom de mamifero."); } } class Boi: Mamifero { o

How to use D-language polymorphism?

2017-02-16 Thread Jean Cesar via Digitalmars-d-learn
I have the following code in c++ using polymorphism how would I convert D-language polymorphism? #include #include class Mamifero { protected: int idade; public: Mamifero(){} ~Mamifero(){} virtual void somMamifero() const { std::cout<<"\n\tSom de mamifero.\n"; } }; c

Re: Copying and moving directories

2017-02-16 Thread Jonathan M Davis via Digitalmars-d-learn
On Thursday, February 16, 2017 16:47:05 Chris via Digitalmars-d-learn wrote: > On Thursday, 16 February 2017 at 16:41:48 UTC, Adam D. Ruppe > > wrote: > > On Thursday, 16 February 2017 at 16:38:51 UTC, Chris wrote: > >> In `std.file`, I haven't found a function that allows me to > >> move or at lea

Re: Copying and moving directories

2017-02-16 Thread Chris via Digitalmars-d-learn
On Thursday, 16 February 2017 at 16:41:48 UTC, Adam D. Ruppe wrote: On Thursday, 16 February 2017 at 16:38:51 UTC, Chris wrote: In `std.file`, I haven't found a function that allows me to move or at least copy directories, as in `mv dir /toDir`. Do I have to go the awkward way over `rename` or

Re: Copying and moving directories

2017-02-16 Thread Adam D. Ruppe via Digitalmars-d-learn
On Thursday, 16 February 2017 at 16:38:51 UTC, Chris wrote: In `std.file`, I haven't found a function that allows me to move or at least copy directories, as in `mv dir /toDir`. Do I have to go the awkward way over `rename` or something? Have you already tried just renaming the directory?

Copying and moving directories

2017-02-16 Thread Chris via Digitalmars-d-learn
In `std.file`, I haven't found a function that allows me to move or at least copy directories, as in `mv dir /toDir`. Do I have to go the awkward way over `rename` or something?

Re: opApply with Type Inference and Templates?

2017-02-16 Thread Ali Çehreli via Digitalmars-d-learn
On 02/15/2017 07:20 PM, Jerry wrote: I am trying to do opApply to work when the delegate passed when it is and isn't nogc/nothrow. As soon as you involve a template though, type inference goes out the door. I want to be able to use opApply with templates (to get the auto @nogc/nothrow deducation

Re: opApply with Type Inference and Templates?

2017-02-16 Thread Jerry via Digitalmars-d-learn
On Thursday, 16 February 2017 at 04:09:18 UTC, Basile B. wrote: No, by any chance do you ask this for the tuple unpacking PR ? If so I've also tried and failed. Was just trying to use a container I created in functions with and without @nogc/nothrow.

Re: Can't send messages to tid spawned in a Windows DLL. Bug?

2017-02-16 Thread Atila Neves via Digitalmars-d-learn
On Thursday, 16 February 2017 at 15:14:25 UTC, kinke wrote: On Thursday, 16 February 2017 at 12:07:40 UTC, Atila Neves wrote: This fails for me in a DLL: auto tid = spawn(&func); assert(tid != Tid.init); If I print out the tid, I find that its message box is null. This is odd, since according

Re: Can't send messages to tid spawned in a Windows DLL. Bug?

2017-02-16 Thread kinke via Digitalmars-d-learn
On Thursday, 16 February 2017 at 12:07:40 UTC, Atila Neves wrote: This fails for me in a DLL: auto tid = spawn(&func); assert(tid != Tid.init); If I print out the tid, I find that its message box is null. This is odd, since according the code in std.concurrency there's nothing weird about how

Re: Getting a segfault here, why?

2017-02-16 Thread crimaniak via Digitalmars-d-learn
On Thursday, 16 February 2017 at 09:18:16 UTC, aberba wrote: On linux it is pretty easy. Just compile with `-g` to dmd and run the program in gdb. Run till it crashes and it should tell you the file and line of where. Thanks, will try and see. Also don't forget to do this: http://vibed.org/d

Can't send messages to tid spawned in a Windows DLL. Bug?

2017-02-16 Thread Atila Neves via Digitalmars-d-learn
This fails for me in a DLL: auto tid = spawn(&func); assert(tid != Tid.init); If I print out the tid, I find that its message box is null. This is odd, since according the code in std.concurrency there's nothing weird about how it gets a message box, it's just `auto spawnTid = Tid(new Message

Re: Get the address of an object, within the object itself

2017-02-16 Thread Jacob Carlborg via Digitalmars-d-learn
On 2017-02-15 22:42, Andrew Chapman wrote: Thanks Jonathan. Good point about the reference address. I can work around this quite easily, but I was curious. I will try the void* cast and see what happens. If it's only for printing you can use the C "printf" without any casting: import core.

Re: Getting a segfault here, why?

2017-02-16 Thread aberba via Digitalmars-d-learn
On Wednesday, 15 February 2017 at 18:22:53 UTC, Adam D. Ruppe wrote: On Wednesday, 15 February 2017 at 18:19:18 UTC, aberba wrote: Trying to find it but working with a debugger in D is not straight forward. Not yo talk of interpretating the debugger output. On linux it is pretty easy. Just co