Re: How to work with hashmap from memutils properly?

2022-02-10 Thread Siarhei Siamashka via Digitalmars-d-learn
On Thursday, 10 February 2022 at 20:39:45 UTC, Sergey wrote: Code could be found here: https://github.com/cyrusmsk/lang_benchmark/tree/main/lru/source/d_comparison/mem Is this an attempt to implement a high performance solution for the Benchmarks Game's LRU problem in D language? PS it seem

How to work with hashmap from memutils properly?

2022-02-10 Thread Sergey via Digitalmars-d-learn
Could someone help with memutils library? It seems (based on some posts in 2018) that memutils is one of the fastest hashmap in Dlang world (if you know it is not - please help me find the fastest hashmap realisation). I've made some benchmarks with the same code for regular AA, ikod-containe

Re: Cross Compile to Linux from Windows using LDC?

2022-02-10 Thread kinke via Digitalmars-d-learn
On Thursday, 10 February 2022 at 16:52:32 UTC, H. S. Teoh wrote: If I understand it right, you ought to be able to do the same thing on Windows [...] Not quite; cross-compiling to Windows has been made especially simple and is a special case. When cross-compiling from Windows to Linux, this a

Re: How to update Associative Array?

2022-02-10 Thread Ali Çehreli via Digitalmars-d-learn
On 2/10/22 05:42, novice2 wrote: > On Thursday, 10 February 2022 at 12:08:07 UTC, tastyminerals wrote: >> I meant a different thing though. I am looking for >> `mydic.update(another_dic)` analogue where `{"a": 1, "b": 2}` update >> `{"c": 3, "a": -1}` becomes `{"a":-1, "b": 2, "c": 3}`. > > you ne

Re: Cross Compile to Linux from Windows using LDC?

2022-02-10 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Feb 10, 2022 at 04:43:12PM +, Fry via Digitalmars-d-learn wrote: > Is it possible to compile for Linux from Windows using the LDC > compiler? It seems like it is possible to compile for different > architectures Linux x86 -> Linux Arm but what about for Windows x86 -> > Linux x86? I'm

Cross Compile to Linux from Windows using LDC?

2022-02-10 Thread Fry via Digitalmars-d-learn
Is it possible to compile for Linux from Windows using the LDC compiler? It seems like it is possible to compile for different architectures Linux x86 -> Linux Arm but what about for Windows x86 -> Linux x86?

Re: How to update Associative Array?

2022-02-10 Thread novice2 via Digitalmars-d-learn
On Thursday, 10 February 2022 at 12:08:07 UTC, tastyminerals wrote: I meant a different thing though. I am looking for `mydic.update(another_dic)` analogue where `{"a": 1, "b": 2}` update `{"c": 3, "a": -1}` becomes `{"a":-1, "b": 2, "c": 3}`. you need "merge"? https://forum.dlang.org/post/fhh

Re: How to update Associative Array?

2022-02-10 Thread tastyminerals via Digitalmars-d-learn
On Thursday, 10 February 2022 at 12:04:04 UTC, bauss wrote: On Thursday, 10 February 2022 at 10:59:17 UTC, tastyminerals wrote: [...] You can just do: aa[key] = value. If the key exist then it's updated, if it doesn't then it's added. The reason for the update function is simply in cases

Re: How to update Associative Array?

2022-02-10 Thread bauss via Digitalmars-d-learn
On Thursday, 10 February 2022 at 10:59:17 UTC, tastyminerals wrote: Not sure if the `update` method got changed but I am having trouble with understanding it now. I assumed it would work as easy as in Python:) Just do `mydic.update(dic)` or `mydic["key"].update(anotherDic)`. The docs have the

How to update Associative Array?

2022-02-10 Thread tastyminerals via Digitalmars-d-learn
Not sure if the `update` method got changed but I am having trouble with understanding it now. I assumed it would work as easy as in Python:) Just do `mydic.update(dic)` or `mydic["key"].update(anotherDic)`. The docs have the following example. ``` class C{} C[string] aa; C older; C newer; aa

Re: How to use sets in D?

2022-02-10 Thread tastyminerals via Digitalmars-d-learn
On Tuesday, 8 February 2022 at 21:42:06 UTC, H. S. Teoh wrote: On Tue, Feb 08, 2022 at 09:08:47PM +, tastyminerals via Digitalmars-d-learn wrote: [...] > [...] [...] [...] E is whatever key type you want to use. String, or integer ID, or whatever you want to put in your set. [...] T