Re: Unicode function name? ∩

2016-08-27 Thread Tofu Ninja via Digitalmars-d-learn
On Sunday, 28 August 2016 at 05:28:17 UTC, rikki cattermole wrote: On 28/08/2016 5:21 PM, Tofu Ninja wrote: ... Try Ÿ. Yeah Ÿ and π both work but ∩ does not. I think I found my answer though... http://dlang.org/spec/lex.html#IdentifierChar Identifiers start with a letter, _, or universal

Re: Unicode function name? ∩

2016-08-27 Thread Tofu Ninja via Digitalmars-d-learn
On Sunday, 28 August 2016 at 05:21:03 UTC, Tofu Ninja wrote: ... Also visual D seems to recognize its not a valid character and highlights the error which makes me think its known behavior.

Re: Unicode function name? ∩

2016-08-27 Thread rikki cattermole via Digitalmars-d-learn
On 28/08/2016 5:21 PM, Tofu Ninja wrote: Are unicode function names not supported in dmd? bool ∩(A, B)(A a, B b){ return intersect(a, b); } Error: character 0x2229 is not a valid token I won't be terribly disappointed if I can't do this, I really just tried it on a whim, but I thought dmd

Re: Unicode function name? ∩

2016-08-27 Thread Tofu Ninja via Digitalmars-d-learn
On Sunday, 28 August 2016 at 05:21:03 UTC, Tofu Ninja wrote: Are unicode function names not supported in dmd? bool ∩(A, B)(A a, B b){ return intersect(a, b); } Error: character 0x2229 is not a valid token I won't be terribly disappointed if I can't do this, I really just tried it on a

Unicode function name? ∩

2016-08-27 Thread Tofu Ninja via Digitalmars-d-learn
Are unicode function names not supported in dmd? bool ∩(A, B)(A a, B b){ return intersect(a, b); } Error: character 0x2229 is not a valid token I won't be terribly disappointed if I can't do this, I really just tried it on a whim, but I thought dmd supported unicode.

Re: Few questions about concurrency

2016-08-27 Thread rikki cattermole via Digitalmars-d-learn
On 28/08/2016 3:36 AM, Suliman wrote: Message passing is an alternative to relying on globals + mutex's. In the end its implemented by a global + stack FIFO (mailbox). Where it's better? Could you give an example? It is my personal goto when dealing with some form of event loop. Since you

Re: How to pass Compile Time info to source files

2016-08-27 Thread UDW via Digitalmars-d-learn
On Sunday, 28 August 2016 at 02:51:13 UTC, Adam D. Ruppe wrote: The filename passed to the compiler is easy: __FILE__ works in D too, and you can just strip off extra path info with ordinary functions (like std.path's basename or dirname functions). Thanks Adam. Worked like a charm.

Re: How to pass Compile Time info to source files

2016-08-27 Thread Adam D. Ruppe via Digitalmars-d-learn
The filename passed to the compiler is easy: __FILE__ works in D too, and you can just strip off extra path info with ordinary functions (like std.path's basename or dirname functions).

How to pass Compile Time info to source files

2016-08-27 Thread UDW via Digitalmars-d-learn
Hi, I would like to know how to do something like this http://stackoverflow.com/questions/237542/learning-the-source-codes-filename-at-compile-time using dmd or dub. Can somebody point me in the direction of the doco for this please because I can't find it :( ty ss

Re: Proper concurrent nearly lock free efficient nogc storage structures?

2016-08-27 Thread Dicebot via Digitalmars-d-learn
On Saturday, 27 August 2016 at 21:23:04 UTC, Illuminati wrote: On Saturday, 27 August 2016 at 17:27:19 UTC, Dicebot wrote: On Friday, 26 August 2016 at 23:38:02 UTC, Illuminati wrote: Does D have any such thing? I'm having to recreate the wheel here and it isn't fun ;/ Getting in the way of

Re: Proper concurrent nearly lock free efficient nogc storage structures?

2016-08-27 Thread Illuminati via Digitalmars-d-learn
On Saturday, 27 August 2016 at 17:27:19 UTC, Dicebot wrote: On Friday, 26 August 2016 at 23:38:02 UTC, Illuminati wrote: Does D have any such thing? I'm having to recreate the wheel here and it isn't fun ;/ Getting in the way of real work ;/ Surely you would think that with the power D has

Re: How to avoid ctRegex (solved)

2016-08-27 Thread ag0aep6g via Digitalmars-d-learn
On 08/27/2016 07:35 PM, cy wrote: When I saw `auto a = b;` at the module level, I thought that b had to be something you could evaluate at compile time. That's right. But I guess it can be a runtime calculated value, acting like it was assigned in a a static this() clause, No, that's not

Re: How to avoid ctRegex (solved)

2016-08-27 Thread David Nadlinger via Digitalmars-d-learn
On Saturday, 27 August 2016 at 17:47:33 UTC, Dicebot wrote: But actual value of that Regex struct is perfectly known during compile time. Thus it is possible and fine to use it as initializer. You can use any struct or class as initializer if it can be computed during compile-time. Yes,

Re: How to avoid ctRegex (solved)

2016-08-27 Thread Dicebot via Digitalmars-d-learn
On Saturday, 27 August 2016 at 17:35:04 UTC, cy wrote: On Wednesday, 24 August 2016 at 05:29:57 UTC, ag0aep6g wrote: The plain regex function doesn't have such a requirement. It also works with a pattern that's generated at run time, e.g. from user input. But you can use it with a compile time

Re: How to avoid ctRegex (solved)

2016-08-27 Thread cy via Digitalmars-d-learn
On Wednesday, 24 August 2016 at 05:29:57 UTC, ag0aep6g wrote: The plain regex function doesn't have such a requirement. It also works with a pattern that's generated at run time, e.g. from user input. But you can use it with a compile time constant, too. And it works in CTFE then, but it does

Re: Proper concurrent nearly lock free efficient nogc storage structures?

2016-08-27 Thread Dicebot via Digitalmars-d-learn
On Friday, 26 August 2016 at 23:38:02 UTC, Illuminati wrote: Does D have any such thing? I'm having to recreate the wheel here and it isn't fun ;/ Getting in the way of real work ;/ Surely you would think that with the power D has such things would exist by now? There doesn't seem to be

Re: Proper concurrent nearly lock free efficient nogc storage structures?

2016-08-27 Thread Illuminati via Digitalmars-d-learn
On Saturday, 27 August 2016 at 13:12:42 UTC, ZombineDev wrote: On Friday, 26 August 2016 at 23:38:02 UTC, Illuminati wrote: Does D have any such thing? I'm having to recreate the wheel here and it isn't fun ;/ Getting in the way of real work ;/ Surely you would think that with the power D

Re: Few questions about concurrency

2016-08-27 Thread Suliman via Digitalmars-d-learn
Message passing is an alternative to relying on globals + mutex's. In the end its implemented by a global + stack FIFO (mailbox). Where it's better? Could you give an example? Ring transition e.g. system calls are not all that expensive. Its what the kernel does with that system call that is

Re: Proper concurrent nearly lock free efficient nogc storage structures?

2016-08-27 Thread ZombineDev via Digitalmars-d-learn
On Friday, 26 August 2016 at 23:38:02 UTC, Illuminati wrote: Does D have any such thing? I'm having to recreate the wheel here and it isn't fun ;/ Getting in the way of real work ;/ Surely you would think that with the power D has such things would exist by now? Here's two popular

Re: Proper concurrent nearly lock free efficient nogc storage structures?

2016-08-27 Thread Cauterite via Digitalmars-d-learn
On Saturday, 27 August 2016 at 01:06:53 UTC, Illuminati wrote: Surely one of the many intelligent people on this forum should be able to implement some of the basic structures fairly quickly? Most of these people are happy to use the GC, so @nogc structures are not a priority.

Re: Judy Arrays

2016-08-27 Thread Jerry via Digitalmars-d-learn
On Thursday, 25 August 2016 at 20:42:42 UTC, Illuminati wrote: http://judy.sourceforge.net/downloads/10minutes.htm Would be nice to have such an implementation. Supposedly one of the best all around data structures in existence? Maybe D could be used to make them work with arbitrary

Re: Does D have any construct like Python's with keyword?

2016-08-27 Thread Daniel Kozak via Digitalmars-d-learn
Dne 27.8.2016 v 02:04 pineapple via Digitalmars-d-learn napsal(a): I would just love if I could express this as something more like context(auto file = File("some_file.txt")){ file.write(); } void main(string[] args) { with(File("some_file.txt")) { write();

Re: Few questions about concurrency

2016-08-27 Thread rikki cattermole via Digitalmars-d-learn
On 27/08/2016 7:30 PM, Suliman wrote: Hello! I am still attempt to better understand how concurrency works. I read a lot of info but still misunderstood some key-points. Here is my thought about it and questions: 1. There is OS threads. Context-switching is very expensive because during it we

Few questions about concurrency

2016-08-27 Thread Suliman via Digitalmars-d-learn
Hello! I am still attempt to better understand how concurrency works. I read a lot of info but still misunderstood some key-points. Here is my thought about it and questions: 1. There is OS threads. Context-switching is very expensive because during it we should to save ALL CPU registers to

Re: How to call a method of class D from function of C++ in DLL?

2016-08-27 Thread Nicholas Wilson via Digitalmars-d-learn
On Saturday, 27 August 2016 at 04:44:10 UTC, MGW wrote: Method which I use now: source D: - extern (C) { int on_metFromD(CEditWin* uk, int aa, int bb) { return (*uk).metFromD(int aa, int bb); } } class CEditWin { . . . // Method for to call int metFromD(int