Re: Unittests not firing?

2021-06-11 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Jun 11, 2021 at 02:05:31PM -0700, H. S. Teoh wrote: [...] > Huh, that doesn't look right. This was fixed since June last year, so it > *should* have made it into the latest compiler releases already. Unless > this one was missed somehow (but I doubt it). [...] Just checked on LDC 1.26.0,

Re: Unittests not firing?

2021-06-11 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Jun 11, 2021 at 08:30:28PM +, Mike Brown via Digitalmars-d-learn wrote: > On Friday, 11 June 2021 at 16:28:48 UTC, H. S. Teoh wrote: > > On Fri, Jun 11, 2021 at 03:20:49PM +, Mike Brown via > > Digitalmars-d-learn wrote: > > > On Friday, 11 June 2021 at 15:13:17 UTC, rikki

Re: Two interpretations

2021-06-11 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Jun 11, 2021 at 03:00:00PM +, JG via Digitalmars-d-learn wrote: > Is it specified somewhere which way the following program will be > interpreted? > > import std; > > struct A > { > int x=17; > } > > int x(A a) > { > return 100*a.x; > } >

Re: Unittests not firing?

2021-06-11 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Jun 11, 2021 at 03:20:49PM +, Mike Brown via Digitalmars-d-learn wrote: > On Friday, 11 June 2021 at 15:13:17 UTC, rikki cattermole wrote: [...] > Right OK, mine says 1/1 unittests failed - but this should say > Modules? > > I will interpret it as Modules, ty! This is a bug that was

Re: Faster Dlang Execution

2021-06-08 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Jun 08, 2021 at 05:10:47PM +, seany via Digitalmars-d-learn wrote: [...] > Profiling doesn't help, because different input is causing different > parts of the program to become slow. [...] Do you have any more specific information about what kind of inputs cause which parts of the

Re: how to enable safeD ? dmd.conf ? dmd switch ?

2021-06-07 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Jun 08, 2021 at 02:47:18AM +, someone via Digitalmars-d-learn wrote: > https://dlang.org/articles/safed.html > https://dlang.org/dmd-linux.html#switches > http://ddili.org/ders/d.en/functions_more.html > > Neither man dmd nor man dmd.conf appear to have a related/switch > setting. >

Re: is it possible to have a default property for any given class ?

2021-06-07 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Jun 07, 2021 at 03:26:27PM +, someone via Digitalmars-d-learn wrote: > Consider the following code: > > ```d > class classComputer { [...] > } > > class classComputers { > >classComputers lhs; >classComputers rhs; > >int opApply(int delegate(classComputers) dg) { ///

Re: regarding what seems (to me) unnecessary casts on integer expressions

2021-06-07 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Jun 05, 2021 at 01:46:45AM +, someone via Digitalmars-d-learn wrote: [...] > As I am writing code today I am encountering a lot of these situations. > > cast(ushort)(this.pintBottom1 - 1) > > My first walkaround for this was intuitive: > > this.pintBottom1 - cast(ushort) 1 /// I

Re: General rule when not to write ;

2021-05-19 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, May 19, 2021 at 05:53:12PM +, Alain De Vos via Digitalmars-d-learn wrote: > It seems I need }; for a function a delegate and an alias. > ``` > double function(int) F = function double(int x) {return x/10.0;}; > double delegate(int) D = delegate double(int x) {return c*x/10.0;}; >

Re: stack out of scope ?

2021-05-16 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, May 16, 2021 at 06:33:04PM +, Alain De Vos via Digitalmars-d-learn wrote: > On Sunday, 16 May 2021 at 18:27:40 UTC, H. S. Teoh wrote: [...] > > -snip- > > import std.stdio:writeln; > > > > int [] fun() @safe {// N.B.: need @safe > >

Re: stack out of scope ?

2021-05-16 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, May 16, 2021 at 05:24:40PM +, Alain De Vos via Digitalmars-d-learn wrote: > On Sunday, 16 May 2021 at 16:58:15 UTC, H. S. Teoh wrote: > > On Sun, May 16, 2021 at 04:40:53PM +, Alain De Vos via > > Digitalmars-d-learn wrote: > > > This works also, > > > > > > ``` > > > import

Re: stack out of scope ?

2021-05-16 Thread H. S. Teoh via Digitalmars-d-learn
On Sun, May 16, 2021 at 04:40:53PM +, Alain De Vos via Digitalmars-d-learn wrote: > This works also, > > ``` > import std.stdio:writeln; > > int [] fun(){ > int[3]s=[1,2,3]; > int[] r=s; > return r; > } > > void main(){ > writeln(fun()[0]); > } > ```

Re: ugly and/or useless features in the language.

2021-05-16 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, May 15, 2021 at 02:31:08PM +, Alain De Vos via Digitalmars-d-learn wrote: > Which parts in dlang don't you use and why ? > > Personally i have no need for enum types, immutable is doing fine. > Auto return types i find dangerous to use. > Voldermont types. > Named initialiser. >

Re: Recommendations on avoiding range pipeline type hell

2021-05-16 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, May 15, 2021 at 11:25:10AM +, Chris Piker via Digitalmars-d-learn wrote: [...] > Basically the issue is that if one attempts to make a range based > pipeline aka: > > ```d > auto mega_range = range1.range2!(lambda2).range3!(lambda3); > ``` > Then the type definition of mega_range is

Re: CTFE Assignment to anonymous union shows unexpected behavior

2021-04-22 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Apr 22, 2021 at 11:44:51PM +, Rekel via Digitalmars-d-learn wrote: > On Thursday, 22 April 2021 at 23:41:33 UTC, H. S. Teoh wrote: > > On Thu, Apr 22, 2021 at 10:47:17PM +, Rekel via Digitalmars-d-learn > > wrote: > > > I'm not sure why this is happening, but after simplifying my

Re: CTFE Assignment to anonymous union shows unexpected behavior

2021-04-22 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Apr 22, 2021 at 10:47:17PM +, Rekel via Digitalmars-d-learn wrote: > I'm not sure why this is happening, but after simplifying my code I > traced it back to what the title may suggest. Keep in mind that CTFE does not support reinterpretation via unions, i.e., reading values from a

Re: write once type?

2021-04-20 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Apr 20, 2021 at 03:56:33PM -0400, Steven Schveighoffer via Digitalmars-d-learn wrote: [...] > I'm wondering if anyone has a "Write once" type, that is, a type that > allows you to write it exactly once, and is treated like > initialization on first setting (i.e. allows writing to

Re: How do I create classes dynamically?

2021-04-15 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Apr 15, 2021 at 08:56:18PM +, mw via Digitalmars-d-learn wrote: [...] > of course, one can manually dispatch: > > if (userInputString == "cat") createCat(); > else if (userInputString == "dog") createDog(); > ... > > but this this tedious. --- // Disclaimer:

Re: Is there a more elegant way to do this in D?

2021-04-08 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Apr 08, 2021 at 08:28:44PM +, Alain De Vos via Digitalmars-d-learn wrote: > The ascii code of 0 is 48 so I think you can add everywhere 48 (but > I'm not a specialist) Why bother with remembering it's 48? Just add '0', like this: int a = [1, 0, 1, 0, 1, ...]; string

Re: what exactly is string length?

2021-04-01 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Apr 02, 2021 at 05:05:21AM +, mw via Digitalmars-d-learn wrote: [...] > This is just an example, what if the exact length is not known > statically, is there a functions to trim the `\0`s? Another way, if you want to avoid the extra allocation, slice the static array with .indexOf:

Re: what exactly is string length?

2021-04-01 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Apr 02, 2021 at 05:05:21AM +, mw via Digitalmars-d-learn wrote: [...] > This is just an example, what if the exact length is not known > statically, is there a functions to trim the `\0`s? What about `s.until('\0')`? Example: auto s = "abc\0\0\0def"; auto t = "blah"

Re: what exactly is string length?

2021-04-01 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Apr 02, 2021 at 04:32:53AM +, mw via Digitalmars-d-learn wrote: [...] > --- > import std; > import std.conv : text; > > > void main() > { > char[6] s; > s = "abc"; > writeln(s, s.length); // abc6, ok it's the static array's length > > string t = text("head-", s,

Re: Need for speed

2021-04-01 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Apr 02, 2021 at 02:36:21AM +, Jon Degenhardt via Digitalmars-d-learn wrote: > On Thursday, 1 April 2021 at 19:55:05 UTC, H. S. Teoh wrote: [...] > > It's interesting that whenever a question about D's performance pops > > up in the forums, people tend to reach for optimization flags.

Re: Need for speed

2021-04-01 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Apr 01, 2021 at 09:16:09PM +, Imperatorn via Digitalmars-d-learn wrote: > On Thursday, 1 April 2021 at 21:13:18 UTC, H. S. Teoh wrote: [...] > > Thanks for the very interesting information; so it looks like most > > of the time spent is actually in copying array elements than > >

Re: Need for speed

2021-04-01 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Apr 01, 2021 at 01:17:15PM -0700, Ali Çehreli via Digitalmars-d-learn wrote: > On 4/1/21 12:55 PM, H. S. Teoh wrote: > > > - Constructing large arrays by appending 1 element at a time with > > `~`. Obviously, this requires many array reallocations and the > > associated copying > > And

Re: Need for speed

2021-04-01 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Apr 01, 2021 at 07:25:53PM +, matheus via Digitalmars-d-learn wrote: [...] > Since this is a "Learn" part of the Foruam, be careful with > "-boundscheck=off". > > I mean for this little snippet is OK, but for a other projects this my > be wrong, and as it says here: >

Re: Need for speed

2021-04-01 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Apr 01, 2021 at 04:52:17PM +, Nestor via Digitalmars-d-learn wrote: [...] > ``` > import std.stdio; > import std.random; > import std.datetime.stopwatch : benchmark, StopWatch, AutoStart; > import std.algorithm; > > void main() > { > auto sw = StopWatch(AutoStart.no); >

Re: Why I need DUB? Will never DMD don't just use import for import packages?

2021-03-29 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Mar 29, 2021 at 07:28:23PM +, Adam D. Ruppe via Digitalmars-d-learn wrote: > On Monday, 29 March 2021 at 19:06:33 UTC, Marcone wrote: > > Why can't I just use: import vibe.vibe; for import packages like Nim > > or Python? Why I still use DUB? > > I don't use dub. Just dmd -i after

Re: What is best way to read and interpret binary files?

2021-03-29 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Mar 30, 2021 at 12:32:36AM +, mw via Digitalmars-d-learn wrote: > On Monday, 19 November 2018 at 22:32:55 UTC, H. S. Teoh wrote: > > Actually, the case is unnecessary, because arrays implicitly convert > > to void[], and pointers are sliceable. So all you need is: > > > >

Re: How to delete dynamic array ?

2021-03-16 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Mar 16, 2021 at 11:28:00PM +, mw via Digitalmars-d-learn wrote: [...] > suppose: > > double[] data; // D type: dynamic array > > As of 2021 what's the correct way to allocate and deallocate (free > memory to the system immediately) D's dynamic array? [...] Note that T[] is just a

Re: Static initialization of associative arrays

2021-03-11 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Mar 11, 2021 at 06:06:35PM +, Chris Piker via Digitalmars-d-learn wrote: [...] > Today I ran across a situation where an immutable associative array > would be handy. While perusing the language spec I noticed here: > > https://dlang.org/spec/hash-map.html#static_initialization >

Re: Broken examples

2021-03-05 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Mar 05, 2021 at 10:01:37PM +, Imperatorn via Digitalmars-d-learn wrote: > Basically none of the examples on here compile: > https://dlang.org/library/std/conv/parse.html > > Any idea why? File a bug. T -- By understanding a machine-oriented language, the programmer will tend to

Re: Can't I allocate at descontructor?

2021-03-05 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Mar 05, 2021 at 08:24:26PM +, Jack via Digitalmars-d-learn wrote: > On Friday, 5 March 2021 at 20:18:44 UTC, Max Haughton wrote: > > On Friday, 5 March 2021 at 20:13:54 UTC, Jack wrote: [...] > > > But the ones heap may never run at all, is that right? > > > > You can't rely on the

Re: Can't I allocate at descontructor?

2021-03-05 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Mar 05, 2021 at 08:03:58PM +, Jack via Digitalmars-d-learn wrote: > On Friday, 5 March 2021 at 09:23:29 UTC, Mike Parker wrote: > > On Friday, 5 March 2021 at 05:31:38 UTC, Jack wrote: > > > The following code returns a memory error. I did notice it did > > > happens whenever I did a

Re: Is there any generic iteration function that stops at first match?

2021-03-04 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Mar 05, 2021 at 02:13:39AM +, Jack via Digitalmars-d-learn wrote: > something like filter[1] but that stops at first match? are there any > native functions for this in D or I have to write one? just making > sure to not reinvent the wheel [...] Why not just .front? E.g.:

Re: How do I run multiple unittests with rdmd?

2021-03-04 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Mar 05, 2021 at 01:47:41AM +, Anthony via Digitalmars-d-learn wrote: > Hello, > > I'm trying to run multiple unittest files with rdmd. > So far I use `find` to just pipe in the files. Eg: > > > time find source -name *__tests.d -exec rdmd -unittest --main > -I../libprelude/source

Re: D's Continous Changing

2021-03-03 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Mar 04, 2021 at 06:43:57AM +, user1234 via Digitalmars-d-learn wrote: > On Thursday, 4 March 2021 at 05:44:53 UTC, harakim wrote: > > For the record, I was able to resolve all of my issues in about 7 > > hours. That included upgrading from DerelictSDL to bindbc and > > converting to

Re: How can I tell if the give parameter can be run at compile time?

2021-03-01 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Mar 01, 2021 at 08:05:57PM +, Jack via Digitalmars-d-learn wrote: > bool g(T)(T) > { > return __traits(compiles, mixin("{ enum a = t; }")); > } > > > int a; > enum s = ""; > // both return false but g(s) is expected to return true > pragma(msg, g(s)); > pragma(msg, g(a));

Re: How do I check if a type is assignable to null at compile time?

2021-02-26 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Feb 27, 2021 at 01:03:56AM +, Jack via Digitalmars-d-learn wrote: > On Friday, 26 February 2021 at 23:37:18 UTC, Murilo wrote: > > On Friday, 26 February 2021 at 05:25:14 UTC, Jack wrote: > > > I started with: > > > > > > enum isAssignableNull(T) = is(T : Object) || isPointer(T); > >

Re: Can Metaprogramming Help Here?

2021-02-26 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Feb 26, 2021 at 11:37:18AM -0800, H. S. Teoh via Digitalmars-d-learn wrote: > On Wed, Feb 24, 2021 at 08:10:30PM +, Mike Brown via Digitalmars-d-learn > wrote: > [...] > > Thank you for the reply. Im struggling extending this to get the > > nesting working. [

Re: Can Metaprogramming Help Here?

2021-02-26 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Feb 24, 2021 at 08:10:30PM +, Mike Brown via Digitalmars-d-learn wrote: [...] > Thank you for the reply. Im struggling extending this to get the > nesting working. > > I'm trying something like: > > string entry(string i, string[] inherit = []) { > return i; > } > > alias

Re: DUB is not working correctly

2021-02-26 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Feb 26, 2021 at 06:53:32PM +, evilrat via Digitalmars-d-learn wrote: > On Friday, 26 February 2021 at 18:20:38 UTC, Maxim wrote: > > On Friday, 26 February 2021 at 17:57:12 UTC, ryuukk_ wrote: > > > "targetType": "executable", > > > > > > and it should just run using "dub run" > >

Re: DUB is not working correctly

2021-02-24 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Feb 24, 2021 at 06:32:00PM +, Maxim via Digitalmars-d-learn wrote: > On Wednesday, 24 February 2021 at 18:21:40 UTC, evilrat wrote: > > On Wednesday, 24 February 2021 at 17:45:56 UTC, Maxim wrote: > > > > > > Unfortunately, I tried bindbc-sfml package but the problem is > > > still

Re: Compile-Time Function Parameters That Aren't Types?

2021-02-23 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Feb 24, 2021 at 03:52:57AM +, Kyle Ingraham via Digitalmars-d-learn wrote: [...] > I was under the impression that compile-time or template parameters > were only for types. In D, template parameters can take not only types, but almost any type (provided they are constructible at

Re: Can Metaprogramming Help Here?

2021-02-23 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Feb 23, 2021 at 10:24:50PM +, Mike Brown via Digitalmars-d-learn wrote: > Hi all, > > Im porting some C++ code, which has a mess of a section that > implements prime number type id's. I've had to smother it to death > with test cases to get it reliable, I think metaprogramming that D

Re: How to get Laptop battery level

2021-02-22 Thread H. S. Teoh via Digitalmars-d-learn
On Mon, Feb 22, 2021 at 08:59:01PM +, Greatsam4sure via Digitalmars-d-learn wrote: > Dlang is a system programming language. How do I access the battery > level of my system using code in dlang? I will appreciate vide sample There is no universal API for this. It depends on which OS you're

Re: Struct delegate access corruption

2021-02-17 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Feb 17, 2021 at 03:38:00PM +, z via Digitalmars-d-learn wrote: > So i've upgraded one of my structs to use the more flexible delegates > instead of function pointers but when the member function tries to > access the struct's members, the contents are random and the program > fails.

Re: Fastest way to "ignore" elements from array without removal

2021-02-15 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Feb 16, 2021 at 04:20:06AM +, z via Digitalmars-d-learn wrote: > What would be the overall best manner(in ease of implementation and > speed) to arbitrarily remove an item in the middle of an array while > iterating through it? > So far i've thought about simply using D's standard

Re: Trying to reduce memory usage

2021-02-12 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Feb 12, 2021 at 07:23:12AM +, frame via Digitalmars-d-learn wrote: > On Friday, 12 February 2021 at 02:22:35 UTC, H. S. Teoh wrote: > > > This turns the OP's O(n log n) algorithm into an O(n) algorithm, > > doesn't need to copy the entire content of the file into memory, and > > also

Re: Trying to reduce memory usage

2021-02-11 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Feb 12, 2021 at 01:45:23AM +, mw via Digitalmars-d-learn wrote: > On Friday, 12 February 2021 at 01:23:14 UTC, Josh wrote: > > I'm trying to read in a text file that has many duplicated lines and > > output a file with all the duplicates removed. > > If you only need to remove

Re: Real simple unresolved external symbols question...

2021-02-10 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Feb 10, 2021 at 11:35:27PM +, WhatMeWorry via Digitalmars-d-learn wrote: [...] > Okay, thanks. Then why does the README.md at > > https://github.com/dlang/druntime > > say "Runtime is typically linked together with Phobos in a release > such that the compiler only has to link to a

Re: Is there a generic type such as void* or C#'s object?

2021-02-05 Thread H. S. Teoh via Digitalmars-d-learn
On Sat, Feb 06, 2021 at 02:01:28AM +, Jack via Digitalmars-d-learn wrote: > in C/C++ you have void* and C#'s object, to create a variable to hold > a genetic type. So in C# you can do: > > class A { > object foo; > } > > and > > var a = new A(); > a.foo = any class...; > > does D have

Re: Any tools to track heap/stack corruptions?

2021-02-03 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Feb 03, 2021 at 03:47:34PM +, Imperatorn via Digitalmars-d-learn wrote: > On Wednesday, 3 February 2021 at 14:00:23 UTC, JN wrote: > > I am dealing with some nasty issue in my code. Basically random > > unrelated lines of code are crashing with access violations, and if > > I switch

Re: Any tools to track heap/stack corruptions?

2021-02-03 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Feb 03, 2021 at 02:00:23PM +, JN via Digitalmars-d-learn wrote: > I am dealing with some nasty issue in my code. Basically random > unrelated lines of code are crashing with access violations, and if I > switch from dmd to ldc the crash goes away, or crash comes back, or it > crashes

Re: What does this code snippet even do?

2021-01-29 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Jan 29, 2021 at 10:41:33PM +, WhatMeWorry via Digitalmars-d-learn wrote: > // The following four lines in run.lang.io > > int[] a; > alias T = long; > pragma(msg, is(typeof(a) : U[], U : T)); This means: "does the type of 'a' have the form U[], where U is a type that implicitly

Re: Why filling AA in shared library freezes execution?

2021-01-29 Thread H. S. Teoh via Digitalmars-d-learn
On Fri, Jan 29, 2021 at 12:45:02PM +, Imperatorn via Digitalmars-d-learn wrote: > On Wednesday, 27 January 2021 at 15:25:17 UTC, H. S. Teoh wrote: > > On Wed, Jan 27, 2021 at 02:39:08PM +, Adam D. Ruppe via > > Digitalmars-d-learn wrote: > > > On Wednesday, 27 January 2021 at 14:36:16

Re: unittests and imported modules

2021-01-28 Thread H. S. Teoh via Digitalmars-d-learn
To answer your other question: On Thu, Jan 28, 2021 at 07:44:59PM +, kdevel via Digitalmars-d-learn wrote: [...] > After inserting print statements into the other modules I found that > the additional four unittests originate from the imported files. Is > there a trick to get only the

Re: unittests and imported modules

2021-01-28 Thread H. S. Teoh via Digitalmars-d-learn
On Thu, Jan 28, 2021 at 07:44:59PM +, kdevel via Digitalmars-d-learn wrote: > Today I moved some functions to a new module within the same package > and ran > >dmd -g -i -unittest -checkaction=context -main -run . > > dmd reported > >5 unittests passed Which version of dmd is this?

Re: How to dinamically create Tuples?

2021-01-27 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Jan 27, 2021 at 05:17:18PM +, Paul Backus via Digitalmars-d-learn wrote: > On Wednesday, 27 January 2021 at 17:11:52 UTC, Leonardo wrote: > > Hi, I want to know if are some way to dinamically create Tuples, > > with variable size and types defined at runtime. Thanks. > > No. D is a

Re: Why filling AA in shared library freezes execution?

2021-01-27 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Jan 27, 2021 at 02:39:08PM +, Adam D. Ruppe via Digitalmars-d-learn wrote: > On Wednesday, 27 January 2021 at 14:36:16 UTC, Adam D. Ruppe wrote: > > (btw as for me fixing it myself > > oh edit, I should point out it also requires some degree of language > change to match what

Re: 200-600x slower Dlang performance with nested foreach loop

2021-01-26 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Jan 27, 2021 at 01:28:33AM +, Paul Backus via Digitalmars-d-learn wrote: > On Tuesday, 26 January 2021 at 23:57:43 UTC, methonash wrote: > > > Using AA's may not necessarily improve performance. It depends on > > > what your code does with it. Because AA's require random access > >

Re: 200-600x slower Dlang performance with nested foreach loop

2021-01-26 Thread H. S. Teoh via Digitalmars-d-learn
On Tue, Jan 26, 2021 at 06:13:54PM +, methonash via Digitalmars-d-learn wrote: [...] > I cannot post the full source code. Then we are limited in how much we can help you. > Regarding a reduced version reproducing the issue: well, that's > exactly what the nested foreach loop does. Without

Re: 200-600x slower Dlang performance with nested foreach loop

2021-01-26 Thread