Re: Make shared static this() encoding table compilable

2022-03-14 Thread Salih Dincer via Digitalmars-d-learn
On Monday, 14 March 2022 at 09:40:00 UTC, zhad3 wrote: [...] I usually compile my projects using LDC where this works fine, but I don't want to force others to use LDC because of this one problem. Hence I'd like to ask on how to change the code so that it compiles on DMD in release mode (wit

Re: Make shared static this() encoding table compilable

2022-03-14 Thread rikki cattermole via Digitalmars-d-learn
The recommended solution by Unicode is to use Trie tables for Look Up Tables (LUTs). https://en.wikipedia.org/wiki/Trie You can generate these as read only global arrays and are very fast for this.

Re: Make shared static this() encoding table compilable

2022-03-14 Thread Ali Çehreli via Digitalmars-d-learn
On 3/14/22 11:36, Ali Çehreli wrote: > I would experiment with two arrays holding corresponding keys and > values separately: > >ushort[] keys = /* ... */; >ushort[] values = /* ... */; > > And then building the AA from those. Hopefully, -O works better for that > case. Yes, better but n

Re: Make shared static this() encoding table compilable

2022-03-14 Thread Ali Çehreli via Digitalmars-d-learn
On 3/14/22 03:23, bauss wrote: > I think it's a memory issue and it's unlikely to be solved. I could not reproduce the issue but it takes close to 1 minute for 'dmd -O'. Something is definitely wrong there. :) A workaround could be the -lowmem switch: dmd -O -lowmem ... But still, I would

Re: Make shared static this() encoding table compilable

2022-03-14 Thread bauss via Digitalmars-d-learn
On Monday, 14 March 2022 at 09:40:00 UTC, zhad3 wrote: Hey everyone, I am in need of some help. I have written this Windows CP949 encoding table https://github.com/zhad3/zencoding/blob/main/windows949/source/zencoding/windows949/table.d which is used to convert CP949 to UTF-16. After some rese

Re: Make shared static this() encoding table compilable

2022-03-14 Thread Basile B. via Digitalmars-d-learn
On Monday, 14 March 2022 at 09:40:00 UTC, zhad3 wrote: Hey everyone, I am in need of some help. I have written this Windows CP949 encoding table https://github.com/zhad3/zencoding/blob/main/windows949/source/zencoding/windows949/table.d which is used to convert CP949 to UTF-16. After some rese

Make shared static this() encoding table compilable

2022-03-14 Thread zhad3 via Digitalmars-d-learn
Hey everyone, I am in need of some help. I have written this Windows CP949 encoding table https://github.com/zhad3/zencoding/blob/main/windows949/source/zencoding/windows949/table.d which is used to convert CP949 to UTF-16. After some research about how to initialize immutable associative arra

Re: How to exclude function from being imported in D language?

2022-03-14 Thread oculussaw via Digitalmars-d-learn
How can I import and use functions without importing the main(){} function? https://get-vidmateapp.com https://get-mobdroapk.com