On Friday, 22 October 2021 at 07:00:25 UTC, Mike Parker wrote:
[...]
Thank you for such a clear explanation Mike and for a quick reply!
I am not a compiler expert, but I genuinely would like to know
why we have Dmain.
I've been looking at the generated assembly code recently and
noticed the _Dmain function. I didn't notice it before. Then
there is main, where Dmain is called.
Why is that?
How can I get the base type of any
(multidimensional/static/dynamic/associative) array?
Example:
```
void main() {
int[][] intArr;
double[4][] doubleArr;
string[string][] strArr;
intArr.example; // T = int
doubleArr.example; // T = double
strArr.example; // T = string
}
On Friday, 27 August 2021 at 09:51:46 UTC, Mathias LANG wrote:
On Friday, 27 August 2021 at 06:52:10 UTC, Kirill wrote:
Is there a way to do mixin or similar during runtime?
I'm trying to read a csv file and extract data types. Any
ideas on how this should be approached in D are greatly
Is there a way to do mixin or similar during runtime?
I'm trying to read a csv file and extract data types. Any ideas
on how this should be approached in D are greatly appreciated.
On Monday, 12 July 2021 at 05:08:29 UTC, jfondren wrote:
On Monday, 12 July 2021 at 04:25:00 UTC, Kirill wrote:
I know there is isArray!T and similar functionality in
std.traits. But I couldn't find the functionality that can
help me check if I have a multidimensional array. Is there
any? How
I know there is isArray!T and similar functionality in
std.traits. But I couldn't find the functionality that can help
me check if I have a multidimensional array. Is there any? How do
I create my own?
Thanks in advance.
I have a `Tuple!(string, ..., string)[] data` that I would like
to print out:
`a b c`
`1 2 3`
`4 5 6`
Furthermore, I want to be able to print any N rows and M
columns of that table. For instance:
`b c`
`2 3`
or
`1 2 3`
`4 5
On Saturday, 17 April 2021 at 02:14:50 UTC, Paul Backus wrote:
`parallel` requires a range [1], and an associative array is
not a range. To get a range of an AA's keys and values, you can
use the method `.byKeyValue`:
foreach (pair; parallel(example.byKeyValue)) {
I'd like to iterate over an associative array and output it's key
and value using parallel from std.parallelism.
But I get an error message: ParallelForeach!(int[string]) error
instantiating.
My code:
auto example = ["apples": 100, "orange": 250, "banana": 175];
foreach(key, value;
On Monday, 28 December 2020 at 07:00:59 UTC, Ali Çehreli wrote:
On 12/27/20 10:24 PM, Kirill wrote:
Hello, is there a tool to measure the execution time of a
function in D? Can the GC do it?
StopWatch and benchmark():
https://dlang.org/phobos/std_datetime.html
Ali
Thanks Ali! That's
Hello, is there a tool to measure the execution time of a
function in D? Can the GC do it?
On Saturday, 29 August 2020 at 12:06:38 UTC, Andre Pany wrote:
On Saturday, 29 August 2020 at 11:27:28 UTC, Kirill wrote:
I need a stand-alone executable that does not require the user
to install any libraries on their computer. Everything should
be packed into the executable.
I understand
I need a stand-alone executable that does not require the user to
install any libraries on their computer. Everything should be
packed into the executable.
I understand that I need to statically link all of the libraries
I use in my project, but how do I do this? What do I need to add
to
On Sunday, 28 June 2020 at 05:13:32 UTC, Mike Parker wrote:
On Sunday, 28 June 2020 at 04:59:12 UTC, Kirill wrote:
something.d:
module something;
int add(int a, int b);
This should be extern(C) int add(int a, int b). The extern(C)
tells the D compiler to use the standard C calling
Hello. I am learning how to translate C headers to D. But how do
I compile it? I am stuck with this.
I have 4 files in the same directory: main.d, something.d,
some.h, some.c
some.h:
//header guards
int add(int a, int b);
some.c:
#include "some.h"
int add(int a, int b) { return a+b; }
On Saturday, 21 March 2020 at 04:58:32 UTC, Mike Parker wrote:
In D, the unit of encapsulation is the module. So private means
"private to the module", i.e., private members are accessible
within the same module. If ID were in a different module from
main, you would see an error.
Indeed, I
I was playing around with visibility attributes in D. I created a
class with private variables. Then I tried to access those
variables through the class object. It compiled without any
errors. However, ...
Shouldn't the compiler output an error for trying to access
private members of a
I would also be curious to see projects in D that involved cache
optimization.
Dear D community (and specifically experts on cache optimization),
I'm a C++ programmer and was waiting for a while to do a project
in D.
I'd like to build a cache-optimized decision tree forest library,
and I'm debating between D and C++. I'd like to make it similar
to atlas, spiral, or
20 matches
Mail list logo