Re: Build fully static library by the compiler?

2024-08-09 Thread Alex Bryan via Digitalmars-d-learn
On Friday, 9 August 2024 at 02:34:03 UTC, Denis Feklushkin wrote: We can build static library directly from the compiler: $ ldc2 --lib app.d produces app.a file with app.o inside of it. Are there simple way to make a static library that also includes necessary standard D libraries (i.e., phob

Re: How to set include paths of a c source in dub when using importc

2024-04-16 Thread Alex Bryan via Digitalmars-d-learn
If you're not using gdc exclusively, you'll want to take a look at this: https://github.com/dlang/dub/pull/2818

Re: regex matching but not capturing

2023-04-06 Thread Alex Bryan via Digitalmars-d-learn
On Thursday, 6 April 2023 at 15:52:16 UTC, Paul wrote: My regex is matching but doesnt seem to be capturing. You may recognize this from the AOC challenges. file contains... **Valve AA has flow rate=0; tunnels lead to valves DD, II, BB** **Valve BB has flow rate=13; tunnels lead to valves CC,

Re: Proper way to accept either static or dynamic array as a parameter

2021-09-11 Thread Alex Bryan via Digitalmars-d-learn
On Sunday, 12 September 2021 at 02:49:48 UTC, jfondren wrote: On Sunday, 12 September 2021 at 02:44:36 UTC, Alex Bryan wrote: `T[] dynArr` can be passed (by reference) to a function that takes `ref T[] data` but `T[10] data` cannot? Why not? ```d void add1(ref int[] nums) { nums ~= 1; } u

Re: Proper way to accept either static or dynamic array as a parameter

2021-09-11 Thread Alex Bryan via Digitalmars-d-learn
On Sunday, 12 September 2021 at 01:48:07 UTC, H. S. Teoh wrote: On Sun, Sep 12, 2021 at 01:08:17AM +, Alex Bryan via Digitalmars-d-learn wrote: I am having trouble discovering what the proper (or at least a proper) way is to write a function that can take either a static or dynamic array

Proper way to accept either static or dynamic array as a parameter

2021-09-11 Thread Alex Bryan via Digitalmars-d-learn
I am having trouble discovering what the proper (or at least a proper) way is to write a function that can take either a static or dynamic array as a parameter. My current implementation consists of 2 overloaded functions (one takes a dynamic array, the other takes a static array) with 99% copy