A way to mixin during runtime?

2021-08-27 Thread Kirill via Digitalmars-d-learn
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.

Re: A way to mixin during runtime?

2021-08-27 Thread dangbinghoo via Digitalmars-d-learn
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 appreciated. remember D is a statically compiled language, `mixin`

Re: A way to mixin during runtime?

2021-08-27 Thread jfondren via Digitalmars-d-learn
On Friday, 27 August 2021 at 10:34:27 UTC, Kirill wrote: Each csv file will be different. For example: ``` name;surname;age;grade Alex;Wong;18;87 John;Doe;19;65 Alice;Doe;18;73 etc... ``` I'd like to extract the data types automatically. For instance, if using tuples: ``` Tuple!(string,

Re: A little help with Ranges

2021-08-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/27/21 12:41 AM, Merlin Diavova wrote: On Friday, 27 August 2021 at 04:01:19 UTC, Ali Çehreli wrote: On 8/26/21 7:17 PM, Merlin Diavova wrote: [...] Then the operations downstream will not produce any results. For example, the array will be empty below: import std.stdio; import

Re: A way to mixin during runtime?

2021-08-27 Thread Mathias LANG via Digitalmars-d-learn
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 appreciated. You cannot mixin at runtime. However, it is fairly

DUB: How to link an external library on Windows 10?

2021-08-27 Thread Ki Rill via Digitalmars-d-learn
I have a Raylib project on Windows using DUB. I've added raylib-d via `dub add`. But what I can't figure out is how to tell DUB to link against raylib library. I have the following project structure: ``` -> source ---> app.d -> libraylib.a -> raylib.dll -> etc... ``` I'd like to use either .a

Re: DUB: How to link an external library on Windows 10?

2021-08-27 Thread Mike Parker via Digitalmars-d-learn
On Friday, 27 August 2021 at 13:21:04 UTC, Ki Rill wrote: I have a Raylib project on Windows using DUB. I've added raylib-d via `dub add`. But what I can't figure out is how to tell DUB to link against raylib library. I have the following project structure: ``` -> source ---> app.d ->

Re: A way to mixin during runtime?

2021-08-27 Thread Kirill via Digitalmars-d-learn
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

Re: DUB: How to link an external library on Windows 10?

2021-08-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/27/21 9:21 AM, Ki Rill wrote: I have a Raylib project on Windows using DUB. I've added raylib-d via `dub add`. But what I can't figure out is how to tell DUB to link against raylib library. I have the following project structure: ``` -> source ---> app.d -> libraylib.a -> raylib.dll ->

Re: DUB: How to link an external library on Windows 10?

2021-08-27 Thread Mike Parker via Digitalmars-d-learn
On Friday, 27 August 2021 at 14:46:56 UTC, Ki Rill wrote: On Friday, 27 August 2021 at 13:54:18 UTC, Steven Schveighoffer wrote: [...] How do I tell DUB where to look for `raylibdll.lib` and `raylib.dll`? Via `lflags` section? What if I put them in a different folder instead of the

Re: DUB: How to link an external library on Windows 10?

2021-08-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/27/21 10:35 AM, Ki Rill wrote: On Friday, 27 August 2021 at 13:54:18 UTC, Steven Schveighoffer wrote: In the end, I got it to build and run, but I'd highly recommend just linking against the `raylibdll.lib` and using the dll. Steve, thank you! I got it working with `raylibdll.lib`!

Re: DUB: How to link an external library on Windows 10?

2021-08-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/27/21 11:19 AM, Ki Rill wrote: On Friday, 27 August 2021 at 14:52:15 UTC, Mike Parker wrote: On Friday, 27 August 2021 at 14:46:56 UTC, Ki Rill wrote: On Friday, 27 August 2021 at 13:54:18 UTC, Steven Schveighoffer wrote: [...] How do I tell DUB where to look for `raylibdll.lib` and

Re: DUB: How to link an external library on Windows 10?

2021-08-27 Thread Ki Rill via Digitalmars-d-learn
On Friday, 27 August 2021 at 15:24:14 UTC, Steven Schveighoffer wrote: I suspect your MSVC installation is bad, or there are some other switches causing problems. -Steve Hmm... well, I will use the default setup and think about it later. I mostly use Linux, Windows realm is an uncharted

Re: DUB: How to link an external library on Windows 10?

2021-08-27 Thread Ki Rill via Digitalmars-d-learn
On Friday, 27 August 2021 at 13:33:25 UTC, Mike Parker wrote: On Friday, 27 August 2021 at 13:21:04 UTC, Ki Rill wrote: I have a Raylib project on Windows using DUB. I've added raylib-d via `dub add`. But what I can't figure out is how to tell DUB to link against raylib library. I have the

Re: A way to mixin during runtime?

2021-08-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/27/21 6:34 AM, Kirill wrote: 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

Re: DUB: How to link an external library on Windows 10?

2021-08-27 Thread Ki Rill via Digitalmars-d-learn
On Friday, 27 August 2021 at 13:54:18 UTC, Steven Schveighoffer wrote: [...] How do I tell DUB where to look for `raylibdll.lib` and `raylib.dll`? Via `lflags` section? What if I put them in a different folder instead of the project's directory?

Re: DUB: How to link an external library on Windows 10?

2021-08-27 Thread Ki Rill via Digitalmars-d-learn
On Friday, 27 August 2021 at 13:54:25 UTC, Mike Parker wrote: But assuming you are on a 64-bit system, the DMD will use Visual Studio's linker if you have it installed. If you don't, it will use the lld linker it ships with. Either way, you need to raylib to be compiled with he same version of

Re: DUB: How to link an external library on Windows 10?

2021-08-27 Thread Steven Schveighoffer via Digitalmars-d-learn
On 8/27/21 11:43 AM, Ki Rill wrote: On Friday, 27 August 2021 at 15:24:14 UTC, Steven Schveighoffer wrote: I suspect your MSVC installation is bad, or there are some other switches causing problems. Hmm... well, I will use the default setup and think about it later. I mostly use Linux,

Re: DUB: How to link an external library on Windows 10?

2021-08-27 Thread Mike Parker via Digitalmars-d-learn
On Friday, 27 August 2021 at 13:41:56 UTC, Ki Rill wrote: I have downloaded the pre-compiled binaries from the official [Raylib ](https://github.com/raysan5/raylib/releases/tag/3.7.0) repo. I'm not using Visual Studio. Only dub and a text editor. But assuming you are on a 64-bit system,

Re: DUB: How to link an external library on Windows 10?

2021-08-27 Thread Ki Rill via Digitalmars-d-learn
On Friday, 27 August 2021 at 13:54:18 UTC, Steven Schveighoffer wrote: In the end, I got it to build and run, but I'd highly recommend just linking against the `raylibdll.lib` and using the dll. -Steve Steve, thank you! I got it working with `raylibdll.lib`! SOLUTION: 1. `dub init` 2. `dub

Re: DUB: How to link an external library on Windows 10?

2021-08-27 Thread Ki Rill via Digitalmars-d-learn
On Friday, 27 August 2021 at 14:52:15 UTC, Mike Parker wrote: On Friday, 27 August 2021 at 14:46:56 UTC, Ki Rill wrote: On Friday, 27 August 2021 at 13:54:18 UTC, Steven Schveighoffer wrote: [...] How do I tell DUB where to look for `raylibdll.lib` and `raylib.dll`? Via `lflags` section?