Re: Why is there no named parameter support?

2015-06-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Tuesday, June 09, 2015 01:38:56 Timothee Cour via Digitalmars-d-learn wrote: > On Mon, Jun 8, 2015 at 11:32 PM, Jonathan M Davis via Digitalmars-d-learn < > digitalmars-d-learn@puremagic.com> wrote: > > > On Monday, June 08, 2015 23:18:50 Timothee Cour via Digitalmars-d-learn > > wrote: > > > ni

Re: Why is there no named parameter support?

2015-06-08 Thread Timothee Cour via Digitalmars-d-learn
On Mon, Jun 8, 2015 at 11:32 PM, Jonathan M Davis via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: > On Monday, June 08, 2015 23:18:50 Timothee Cour via Digitalmars-d-learn > wrote: > > nim has both overloading and named arguments (with reordering and > defaults > > allowed): ht

Re: Why is there no named parameter support?

2015-06-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, June 08, 2015 23:18:50 Timothee Cour via Digitalmars-d-learn wrote: > nim has both overloading and named arguments (with reordering and defaults > allowed): http://nim-lang.org/docs/tut1.html#procedures-named-arguments > and it doesn't seem to cause issues. > > Is there a document / thre

Re: Why is there no named parameter support?

2015-06-08 Thread Timothee Cour via Digitalmars-d-learn
nim has both overloading and named arguments (with reordering and defaults allowed): http://nim-lang.org/docs/tut1.html#procedures-named-arguments and it doesn't seem to cause issues. Is there a document / thread that explains the argument against named arguments in more details than 'do not play

Re: Why is there no named parameter support?

2015-06-08 Thread Jonathan M Davis via Digitalmars-d-learn
On Monday, June 08, 2015 20:36:05 Yuxuan Shui via Digitalmars-d-learn wrote: > Is there any reasons/difficulties for not implementing named > parameters? > > There is clearly a need: > > http://forum.dlang.org/thread/wokfqqbexazcguffw...@forum.dlang.org#post-pxndhoskpjxvnoacajaz:40forum.dlang.org

Re: exclude current directory from search path in dmd ?

2015-06-08 Thread Kyoji Klyden via Digitalmars-d-learn
On Tuesday, 9 June 2015 at 00:22:09 UTC, Timothee Cour wrote: On Mon, Jun 8, 2015 at 12:08 AM, Adam D. Ruppe via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: The easiest way is to not use search paths, and instead pass all the modules you want compiled to the compiler direct

Re: Why is there no named parameter support?

2015-06-08 Thread Idan Arye via Digitalmars-d-learn
On Monday, 8 June 2015 at 20:36:10 UTC, Yuxuan Shui wrote: Is there any reasons/difficulties for not implementing named parameters? There is clearly a need: http://forum.dlang.org/thread/wokfqqbexazcguffw...@forum.dlang.org#post-pxndhoskpjxvnoacajaz:40forum.dlang.org http://forum.dlang.org/t

Re: exclude current directory from search path in dmd ?

2015-06-08 Thread Timothee Cour via Digitalmars-d-learn
On Mon, Jun 8, 2015 at 12:08 AM, Adam D. Ruppe via Digitalmars-d-learn < digitalmars-d-learn@puremagic.com> wrote: > The easiest way is to not use search paths, and instead pass all the > modules you want compiled to the compiler directly. Then it will look for > the module name declaration instea

Re: Utf8 to Utf32 cast cost

2015-06-08 Thread Anonymouse via Digitalmars-d-learn
On Monday, 8 June 2015 at 18:48:17 UTC, Daniel Kozak wrote: Yep, but I dont care, I am the one who makes transcode faster, so I am happy with results :P. P.S. I care and probably when I have some spare time I will improve to!dstring too Ah, so you are. I confused you with Kadir Erdem Demir.

Why is there no named parameter support?

2015-06-08 Thread Yuxuan Shui via Digitalmars-d-learn
Is there any reasons/difficulties for not implementing named parameters? There is clearly a need: http://forum.dlang.org/thread/wokfqqbexazcguffw...@forum.dlang.org#post-pxndhoskpjxvnoacajaz:40forum.dlang.org

Re: using D without GC

2015-06-08 Thread Oleg B via Digitalmars-d-learn
On Monday, 8 June 2015 at 13:37:40 UTC, Marc Schütz wrote: On Monday, 8 June 2015 at 12:24:56 UTC, Oleg B wrote: I guess you should follow andrei's post about new allocators! Can you get link to this post? These are some of his posts: http://forum.dlang.org/thread/mku0n4$s35$1...@digitalmar

Re: Utf8 to Utf32 cast cost

2015-06-08 Thread Daniel Kozak via Digitalmars-d-learn
On Mon, 08 Jun 2015 18:16:57 + Anonymouse via Digitalmars-d-learn wrote: > On Monday, 8 June 2015 at 11:44:47 UTC, Daniel Kozák wrote: > > No difference even with GC.disable() results are same. > > Profile! Callgrind is your friend~ Yep, but I dont care, I am the one who makes transcode fas

Re: Utf8 to Utf32 cast cost

2015-06-08 Thread Anonymouse via Digitalmars-d-learn
On Monday, 8 June 2015 at 11:44:47 UTC, Daniel Kozák wrote: No difference even with GC.disable() results are same. Profile! Callgrind is your friend~

Re: Error execute MS function fputc()

2015-06-08 Thread MGW via Digitalmars-d-learn
I found the solution. A problem in different structures of FILE for MSVC and DMC. I take the pointer on structure of FILE from CrtDLL.dll Everything works! // MGW 07.05.15 import core.runtime; // Загрузка DLL Для Win import std.stdio;// writeln version(Windows) { import std

Re: string to char array?

2015-06-08 Thread Kyoji Klyden via Digitalmars-d-learn
On Monday, 8 June 2015 at 09:54:28 UTC, Kagamin wrote: On Sunday, 7 June 2015 at 17:41:11 UTC, Kyoji Klyden wrote: Do you perchance have any links to learning resources for the D runtime(aside from just the github repository), and also maybe x86 architecture stuff? (I know intel has some 1000+

Re: How to remove the key from the `redBlackTree` with comparator" a <= b "?

2015-06-08 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/8/15 6:53 AM, "Per =?UTF-8?B?Tm9yZGzDtnci?= " wrote: On Sunday, 7 June 2015 at 18:50:47 UTC, anonymous wrote: Do not use '<=' as a comparison function with RedBlackTree. It doesn't meet the requirements. Quoting the documentation [1]: Note that less should produce a strict ordering. That

Re: Error execute MS function fputc()

2015-06-08 Thread Steven Schveighoffer via Digitalmars-d-learn
On 6/7/15 12:41 PM, MGW wrote: Hi, everybody! DMD32 D Compiler v2.067.0 I try to cause the fputc function from CrtDLL.DLL and I receive a mistake. Why? import core.runtime; // Загрузка DLL Для Win import std.stdio;// writeln version(Windows) { import std.c.windows.windows; //

Re: using D without GC

2015-06-08 Thread via Digitalmars-d-learn
On Monday, 8 June 2015 at 12:24:56 UTC, Oleg B wrote: I guess you should follow andrei's post about new allocators! Can you get link to this post? These are some of his posts: http://forum.dlang.org/thread/mku0n4$s35$1...@digitalmars.com http://forum.dlang.org/thread/mkl1eh$1mdl$2...@digital

Re: using D without GC

2015-06-08 Thread Oleg B via Digitalmars-d-learn
I guess you should follow andrei's post about new allocators! Did you mean this article http://wiki.dlang.org/Memory_Management#Explicit_Class_Instance_Allocation ?

Re: using D without GC

2015-06-08 Thread Oleg B via Digitalmars-d-learn
I guess you should follow andrei's post about new allocators! Can you get link to this post?

Re: Utf8 to Utf32 cast cost

2015-06-08 Thread Daniel Kozák via Digitalmars-d-learn
On Mon, 08 Jun 2015 11:32:07 + Kagamin via Digitalmars-d-learn wrote: > On Monday, 8 June 2015 at 10:59:45 UTC, Daniel Kozák wrote: > > import std.conv; > > import std.utf; > > import std.datetime; > > import std.stdio; > > > > void f0() { > > string somestr = "some not so long utf8 stri

Re: Utf8 to Utf32 cast cost

2015-06-08 Thread Kagamin via Digitalmars-d-learn
On Monday, 8 June 2015 at 10:59:45 UTC, Daniel Kozák wrote: import std.conv; import std.utf; import std.datetime; import std.stdio; void f0() { string somestr = "some not so long utf8 string forbenchmarking"; dstring str = to!dstring(somestr); } void f1() { string somestr = "some

Re: Utf8 to Utf32 cast cost

2015-06-08 Thread Daniel Kozak via Digitalmars-d-learn
On Monday, 8 June 2015 at 11:06:07 UTC, Daniel Kozák wrote: On Mon, 08 Jun 2015 10:51:53 + weaselcat via Digitalmars-d-learn wrote: On Monday, 8 June 2015 at 10:49:59 UTC, Ilya Yaroshenko wrote: > On Monday, 8 June 2015 at 10:42:00 UTC, Kadir Erdem Demir > wrote: >> I want to use my ch

Re: Utf8 to Utf32 cast cost

2015-06-08 Thread Daniel Kozák via Digitalmars-d-learn
On Mon, 08 Jun 2015 10:51:53 + weaselcat via Digitalmars-d-learn wrote: > On Monday, 8 June 2015 at 10:49:59 UTC, Ilya Yaroshenko wrote: > > On Monday, 8 June 2015 at 10:42:00 UTC, Kadir Erdem Demir wrote: > >> I want to use my char array with awesome, cool std.algorithm > >> functions. Sin

Re: Utf8 to Utf32 cast cost

2015-06-08 Thread Kadir Erdem Demir via Digitalmars-d-learn
Thanks a lot, your answers are very useful for me . Nothing wrong with toUtf32, I just didn't know it.

Re: Utf8 to Utf32 cast cost

2015-06-08 Thread Daniel Kozák via Digitalmars-d-learn
On Mon, 08 Jun 2015 10:41:59 + Kadir Erdem Demir via Digitalmars-d-learn wrote: > I want to use my char array with awesome, cool std.algorithm > functions. Since many of this algorithms requires like slicing > etc.. I prefer to create my string with Utf32 chars. But by > default all strin

Re: How to remove the key from the `redBlackTree` with comparator" a <= b "?

2015-06-08 Thread via Digitalmars-d-learn
On Sunday, 7 June 2015 at 18:50:47 UTC, anonymous wrote: Do not use '<=' as a comparison function with RedBlackTree. It doesn't meet the requirements. Quoting the documentation [1]: Note that less should produce a strict ordering. That is, for two unequal elements a and b, less(a, b) == !less(

Re: Utf8 to Utf32 cast cost

2015-06-08 Thread weaselcat via Digitalmars-d-learn
On Monday, 8 June 2015 at 10:49:59 UTC, Ilya Yaroshenko wrote: On Monday, 8 June 2015 at 10:42:00 UTC, Kadir Erdem Demir wrote: I want to use my char array with awesome, cool std.algorithm functions. Since many of this algorithms requires like slicing etc.. I prefer to create my string with Utf

Re: Utf8 to Utf32 cast cost

2015-06-08 Thread Daniel Kozák via Digitalmars-d-learn
On Mon, 08 Jun 2015 10:41:59 + Kadir Erdem Demir via Digitalmars-d-learn wrote: > I want to use my char array with awesome, cool std.algorithm > functions. Since many of this algorithms requires like slicing > etc.. I prefer to create my string with Utf32 chars. But by > default all strin

Re: Utf8 to Utf32 cast cost

2015-06-08 Thread Ilya Yaroshenko via Digitalmars-d-learn
On Monday, 8 June 2015 at 10:42:00 UTC, Kadir Erdem Demir wrote: I want to use my char array with awesome, cool std.algorithm functions. Since many of this algorithms requires like slicing etc.. I prefer to create my string with Utf32 chars. But by default all strings literals are Utf8 for perf

Utf8 to Utf32 cast cost

2015-06-08 Thread Kadir Erdem Demir via Digitalmars-d-learn
I want to use my char array with awesome, cool std.algorithm functions. Since many of this algorithms requires like slicing etc.. I prefer to create my string with Utf32 chars. But by default all strings literals are Utf8 for performance. With my current knowledge I use to!dhar to convert Utf8

Re: using D without GC

2015-06-08 Thread Andrea Fontana via Digitalmars-d-learn
On Sunday, 7 June 2015 at 16:25:29 UTC, Oleg B wrote: No just reserve some memory and preallocate the buffer you want before using it. It'll be a lot faster and cheaper. I know, it's only for test. You shouldn't be using delete or new for that matter. You should be using malloc + free. And emp

Re: string to char array?

2015-06-08 Thread Kagamin via Digitalmars-d-learn
On Sunday, 7 June 2015 at 17:41:11 UTC, Kyoji Klyden wrote: Do you perchance have any links to learning resources for the D runtime(aside from just the github repository), and also maybe x86 architecture stuff? (I know intel has some 1000+ page pdf on their site, but I think that's more for har

Re: using D without GC

2015-06-08 Thread Mike via Digitalmars-d-learn
On Sunday, 7 June 2015 at 10:16:36 UTC, Oleg B wrote: Hello. I want to try use D without GC and I'm not sure what I do all right. You may want to take a look at this Wiki page. It has several patterns managing memory without the GC: http://wiki.dlang.org/Memory_Management Mike

Re: DFL background tasks

2015-06-08 Thread thedeemon via Digitalmars-d-learn
On Monday, 8 June 2015 at 07:45:28 UTC, Ali Çehreli wrote: > receiveTimeout(dur!"msecs"(0). UFCS makes durations more pleasant: :) receiveTimeout(0.msecs) Oh, thanks! I missed this bit. This is much nicer!

Re: DFL background tasks

2015-06-08 Thread Ali Çehreli via Digitalmars-d-learn
Just a couple of minor improvements: On 06/08/2015 12:22 AM, thedeemon wrote: > spawn() a thread and don't pass any GUI controls to it, just > thisTid (identifier of your main UI thread) The owner's thread id is available as 'ownerTid' as well. > receiveTimeout(dur!"msecs"(0). UFCS makes dura

Re: DFL background tasks

2015-06-08 Thread thedeemon via Digitalmars-d-learn
A more general and proper approach is to use message passing from std.concurrency. With DFL it looks like this: you spawn() a thread and don't pass any GUI controls to it, just thisTid (identifier of your main UI thread). In that worker tread when you've got some data to show in the UI (be it e

Re: DFL background tasks

2015-06-08 Thread thedeemon via Digitalmars-d-learn
On Sunday, 7 June 2015 at 13:34:59 UTC, Scroph wrote: I tried your code and it did work, however it still froze the UI while it was retrieving the data. Sure, because now you do your long operation in the UI thread. What happens in the delegate passed to invoke() happens in the main UI thread