function is not callable using argument types ()

2016-12-10 Thread Suliman via Digitalmars-d-learn
import std.stdio; import std.concurrency; void main() { void sp(int i) { receive((int i) { writeln("i: ", i); }); } auto r = new Generator!int( { foreach(i; 1 .. 10) yield(i); });

Re: Separate IP parts

2016-12-10 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 10 December 2016 at 13:21:40 UTC, notna wrote: On Saturday, 10 December 2016 at 08:03:00 UTC, biozic wrote: [...] Well, you know, that's one of the not so great things about Dlang... you cannot even trust the provided examples, if there are any: [...] Those statements

Re: Separate IP parts

2016-12-10 Thread biozic via Digitalmars-d-learn
On Saturday, 10 December 2016 at 03:51:34 UTC, brocolis wrote: How do I separate IP parts with dlang? I found this very cool trick, with C++: http://stackoverflow.com/a/5328190 std::string ip ="192.168.1.54"; std::stringstream s(ip); int a,b,c,d; //to store the 4 ints char ch; //to

Re: mkdir; remove; under Windows throw Exception

2016-12-10 Thread ag0aep6g via Digitalmars-d-learn
On 12/10/2016 04:39 AM, unDEFER wrote: man remove: remove - remove a file or directory That's documentation for C, not for D. The function which removes only files named unlink. The D must guarantee the same behaviour of remove on all OSes. D has no obligation to follow C in function

Re: Separate IP parts

2016-12-10 Thread notna via Digitalmars-d-learn
On Saturday, 10 December 2016 at 08:03:00 UTC, biozic wrote: This would do the same. I wouldn't say it's a trick. import std.format : formattedRead; import std.stdio : writefln; string ipAddr = "192.168.1.54"; int a, b, c, d; formattedRead(ipAddr, "%d.%d.%d.%d", , , , );

Re: staticIota is easy

2016-12-10 Thread Stefan Koch via Digitalmars-d-learn
On Saturday, 10 December 2016 at 01:48:24 UTC, Ali Çehreli wrote: On 12/09/2016 05:34 PM, Stefan Koch wrote: On Friday, 9 December 2016 at 18:52:59 UTC, Ali Çehreli wrote: I thought I needed something like staticIota in a unittest to effect static foreach over a number range and I found one in

Re: function is not callable using argument types ()

2016-12-10 Thread Stefan Koch via Digitalmars-d-learn
On Saturday, 10 December 2016 at 08:41:56 UTC, Suliman wrote: import std.stdio; import std.concurrency; void main() { void sp(int i) { receive((int i) { writeln("i: ", i); }); } auto r = new Generator!int( { foreach(i; 1

Re: Separate IP parts

2016-12-10 Thread aberba via Digitalmars-d-learn
On Saturday, 10 December 2016 at 13:25:13 UTC, Nicholas Wilson wrote: On Saturday, 10 December 2016 at 13:21:40 UTC, notna wrote: On Saturday, 10 December 2016 at 08:03:00 UTC, biozic wrote: [...] Well, you know, that's one of the not so great things about Dlang... you cannot even trust

Re: mkdir; remove; under Windows throw Exception

2016-12-10 Thread Adam D. Ruppe via Digitalmars-d-learn
On Saturday, 10 December 2016 at 18:09:43 UTC, unDEFER wrote: I know, but why it works in Linux by Linux documentation? Coincidence. That detail is undefined in the D documentation which means the implementation is free to do whatever is easier for it in a platform-specific manner.

Re: mkdir; remove; under Windows throw Exception

2016-12-10 Thread unDEFER via Digitalmars-d-learn
On Saturday, 10 December 2016 at 18:30:53 UTC, Adam D. Ruppe wrote: On Saturday, 10 December 2016 at 18:09:43 UTC, unDEFER wrote: I know, but why it works in Linux by Linux documentation? Coincidence. That detail is undefined in the D documentation which means the implementation is free to

Re: Hosting vibe.d on OpenShift

2016-12-10 Thread aberba via Digitalmars-d-learn
On Thursday, 8 December 2016 at 20:37:23 UTC, Tiberiu Gal wrote: On Thursday, 8 December 2016 at 14:03:35 UTC, aberba wrote: I would like to try vibe.d with mongoDB on OpenShit. I managed to do that on Heroku. Do I need a buildpack like vibe.d? Any help will be really appreciated. I've

Re: mkdir; remove; under Windows throw Exception

2016-12-10 Thread unDEFER via Digitalmars-d-learn
On Saturday, 10 December 2016 at 14:10:15 UTC, ag0aep6g wrote: On 12/10/2016 04:39 AM, unDEFER wrote: man remove: remove - remove a file or directory That's documentation for C, not for D. I know, but why it works in Linux by Linux documentation?

Re: [Semi-OT] I don't want to leave this language!

2016-12-10 Thread Igor Shirkalin via Digitalmars-d-learn
On Monday, 5 December 2016 at 20:25:00 UTC, Ilya Yaroshenko wrote: Hi e-y-e, The main problem with D for production is its runtime. GC, DRuntime, Phobos is big constraint for real world software production. The almost only thing I do is real world software production (basically math and

Re: faster "stringification"

2016-12-10 Thread Nicholas Wilson via Digitalmars-d-learn
On Sunday, 11 December 2016 at 02:09:41 UTC, Orut wrote: D nub here. I have a Python script that I'd like to implement in D. For certain parts, the D equivalent was slower than Python's. For example, Python code: #dummy code s = ["abc", "fjkd", "L", "qwa", "r", "uw", "tiro", "bc", "sg",

Re: faster "stringification"

2016-12-10 Thread Stefan Koch via Digitalmars-d-learn
On Sunday, 11 December 2016 at 02:09:41 UTC, Orut wrote: D nub here. I have a Python script that I'd like to implement in D. For certain parts, the D equivalent was slower than Python's. For example, Python code: #dummy code s = ["abc", "fjkd", "L", "qwa", "r", "uw", "tiro", "bc", "sg",

Re: Hosting vibe.d on OpenShift

2016-12-10 Thread Gerald via Digitalmars-d-learn
On Saturday, 10 December 2016 at 17:54:58 UTC, aberba wrote: On Thursday, 8 December 2016 at 20:37:23 UTC, Tiberiu Gal wrote: On Thursday, 8 December 2016 at 14:03:35 UTC, aberba wrote: I would like to try vibe.d with mongoDB on OpenShit. I managed to do that on Heroku. Do I need a buildpack

faster "stringification"

2016-12-10 Thread Orut via Digitalmars-d-learn
D nub here. I have a Python script that I'd like to implement in D. For certain parts, the D equivalent was slower than Python's. For example, Python code: #dummy code s = ["abc", "fjkd", "L", "qwa", "r", "uw", "tiro", "bc", "sg", "k", "jds", "yd"]; for i in range(1000): # a lot of