On Fri, Jul 11, 2025 at 10:17:02PM +, WhatMeWorry via Digitalmars-d-learn
wrote:
> ```
> // working function
>
> SDL_Texture* changeTextureAccess(SDL_Texture *texture, SDL_TextureAccess
> newAccess)
> {
> // pertinent code only
> texture = createTexture(renderer, pixelFormat, newAcces
`ref`; eg `ref SDL_Texture*`; which would
be safer given that the SDL_Texture* provided then has to be a
valid variable to store the pointer into.
As for creating and dereferencing references; without seeing the
errors in question I am not sure I can provide a good answer.
```
// working function
SDL_Texture* changeTextureAccess(SDL_Texture *texture,
SDL_TextureAccess newAccess)
{
// pertinent code only
texture = createTexture(renderer, pixelFormat, newAccess,
width, height);
return texture;
}
```
The above function is working for me when I call it
On Thursday, 27 March 2025 at 06:20:25 UTC, cc wrote:
I got in the habit of using `static immutable` whenever
possible as enum just can't be trusted to use CTFE.
```d
enum string RfuncName = fullyQualifiedName!...
// Oops! Allocates on runtime every frame this is referenced
enum string funcName
On Monday, 24 February 2025 at 16:07:07 UTC, Ian wrote:
Hello,
What's the recommended D way to declare a string constant? Say,
for example, for a path used inside a class constructor? I've
seen const string, immutable, enum etc...
Is this the place for these kinds of questions? Is there a D
On Friday, 21 March 2025 at 13:41:18 UTC, Dennis wrote:
On Thursday, 20 March 2025 at 16:18:32 UTC, WhatMeWorry wrote:
Yup. That was the problem. Thank you. You guys are a sharp.
From dmd version 2.111, there will be a better error message in
this case.
https://github.com/dlang/dmd/pull/210
On Thursday, 20 March 2025 at 16:18:32 UTC, WhatMeWorry wrote:
Yup. That was the problem. Thank you. You guys are a sharp.
From dmd version 2.111, there will be a better error message in
this case.
https://github.com/dlang/dmd/pull/21046
Yup. That was the problem. Thank you. You guys are a sharp.
On Thursday, 20 March 2025 at 02:01:25 UTC, Jonathan M Davis
wrote:
On Wednesday, March 19, 2025 5:48:37 PM MDT H. S. Teoh via
Digitalmars-d-learn wrote:
I thought it was always a miss. :-D At least, it's never
worked for me every time I tried it. I always have to move
the UFCS function to mo
On Wednesday, March 19, 2025 5:48:37 PM MDT H. S. Teoh via Digitalmars-d-learn
wrote:
> On Wed, Mar 19, 2025 at 11:21:15PM +, monkyyy via Digitalmars-d-learn
> wrote:
> [...]
> > ufcs on local functions is hit or miss;
> [...]
>
> I thought it was always a miss. :-D At least, it's never work
On Wed, Mar 19, 2025 at 10:26:54PM +, WhatMeWorry via Digitalmars-d-learn
wrote:
[...]
> The above compiles and executes successfully. But the following fails
> with: app.d(179,13): Error: no property `wasFound` for `i` of type
> `long`
>
> I thought the templated function would take care of
On Wed, Mar 19, 2025 at 11:21:15PM +, monkyyy via Digitalmars-d-learn wrote:
[...]
> ufcs on local functions is hit or miss;
[...]
I thought it was always a miss. :-D At least, it's never worked for me
every time I tried it. I always have to move the UFCS function to
module scope, then it wo
On Wednesday, 19 March 2025 at 22:26:54 UTC, WhatMeWorry wrote:
```
bool wasFound(I)(I result)
{
return(result != -1);
}
bool existPoint(Point b, int cost)
{
auto i = closed.countUntil(b);
if(wasFound(i)) // -1 is returned if no point b is
found in
```
bool wasFound(I)(I result)
{
return(result != -1);
}
bool existPoint(Point b, int cost)
{
auto i = closed.countUntil(b);
if(wasFound(i)) // -1 is returned if no point b is
found in the range
```
The above compiles and executes successfully. But
On Monday, 17 March 2025 at 08:27:17 UTC, Jonathan M Davis wrote:
In any case, the normal way in D to declare a string constant
is to use enum. So, that's primarily what you're going to see
in most code. Whether you choose to do that in your own code is
up to you.
- Jonathan M Davis
Hi Jo
On Sunday, 16 March 2025 at 15:22:04 UTC, Ian wrote:
It seems that in some cases static immutable is preferred, so
why not use that always then, rather than having to keep two
cases in my head?
Enum is the indispensable one, immutable isnt important just
theres a subsection of the community t
On Sunday, March 16, 2025 9:22:04 AM MDT Ian via Digitalmars-d-learn wrote:
> On Tuesday, 25 February 2025 at 00:34:45 UTC, Jonathan M Davis
> wrote:
> > For strings, the way that you normally do constants is with
> > enum, e.g
> >
> > enum foo = "dlang";
> >
> > An enum like this is called a m
On Tuesday, 25 February 2025 at 00:34:45 UTC, Jonathan M Davis
wrote:
For strings, the way that you normally do constants is with
enum, e.g
enum foo = "dlang";
An enum like this is called a manifest constant. And you use
manifest constants for most constants in D, with the caveat
that fo
On Monday, February 24, 2025 9:07:07 AM MST Ian via Digitalmars-d-learn wrote:
> Hello,
>
> What's the recommended D way to declare a string constant? Say,
> for example, for a path used inside a class constructor? I've
> seen const string, immutable, enum etc...
>
> Is this the place for these kin
On Monday, February 24, 2025 11:19:48 AM MST Elias Batek (0xEAB) via
Digitalmars-d-learn wrote:
> For string constants you’ll usually want to mark them as `static
> immutable`. Strings with this combination will usually be put
> into read-only sections (ROM) of the resulting binaries.
>
> Unlike `
On Monday, 24 February 2025 at 16:07:07 UTC, Ian wrote:
Hello,
What's the recommended D way to declare a string constant? Say,
for example, for a path used inside a class constructor? I've
seen const string, immutable, enum etc...
Is this the place for these kinds of questions? Is there a D
On Monday, 24 February 2025 at 16:07:07 UTC, Ian wrote:
Hello,
What's the recommended D way to declare a string constant? Say,
for example, for a path used inside a class constructor? I've
seen const string, immutable, enum etc...
enum vs value is a tradeoff of when a decision is made; not s
Hello,
What's the recommended D way to declare a string constant? Say,
for example, for a path used inside a class constructor? I've
seen const string, immutable, enum etc...
Is this the place for these kinds of questions? Is there a D
stack overflow?
Cheers,
Ian
Just wanted to thank everybody for their suggestions. Ali's code
provided the breakthrough:
```d
import std.stdio;
void main()
{
struct HexBoard(F,I)
{
this(F d, I r, I c) { diameter = d; rows = r; cols = c; }
F diameter;
I rows;
I cols;
}
void displayHexBoard(HB)(HB h) {
w
On Wednesday, 12 February 2025 at 20:55:14 UTC, WhatMeWorry wrote:
```
void main()
{
struct HexBoard(F,I)
{
this(F d, I r, I c) {}
//void displayHexBoard(HexBoard!(F,I) h) {} // this
compiles fine!
}
void displayHexBoard(HexBoard!(F,I) h) {} // error undefined
identifier F and I
On Wednesday, 12 February 2025 at 20:55:14 UTC, WhatMeWorry wrote:
```d
void main()
{
struct HexBoard(F,I)
{
this(F d, I r, I c) {}
//void displayHexBoard(HexBoard!(F,I) h) {} // this
compiles fine!
}
void displayHexBoard(HexBoard!(F,I) h) {} // error undefined
identifier F and I
On Wednesday, 12 February 2025 at 20:55:14 UTC, WhatMeWorry wrote:
```
void main()
{
struct HexBoard(F,I)
{
this(F d, I r, I c) {}
//void displayHexBoard(HexBoard!(F,I) h) {} // this
compiles fine!
}
void displayHexBoard(HexBoard!(F,I) h) {} // error undefined
identifier F and I
On 2/12/25 12:55 PM, WhatMeWorry wrote:
> struct HexBoard(F,I)
> {
> this(F d, I r, I c) {}
> //void displayHexBoard(HexBoard!(F,I) h) {} // this compiles fine!
> }
>
> void displayHexBoard(HexBoard!(F,I) h) {} // error undefined identifier
> F and I
Would isInstanceOf be useful? (Wh
```
void main()
{
struct HexBoard(F,I)
{
this(F d, I r, I c) {}
//void displayHexBoard(HexBoard!(F,I) h) {} // this compiles
fine!
}
void displayHexBoard(HexBoard!(F,I) h) {} // error undefined
identifier F and I
auto h1 = HexBoard!(float,uint)(.25, 3, 7);
auto h2 = HexBoard!(dou
On Friday, 10 January 2025 at 16:57:10 UTC, An wrote:
If the compiler flags this as an warning -> he probably notice
the problem
Lag of error/warn/hint for such case is not helping
Happy coding
I'm trying out making it an error:
https://github.com/dlang/dmd/pull/20696
On 1/12/25 8:55 PM, H. S. Teoh wrote:
> I wish there was some kind of syntactic sugar for assigning ctor
> parameters to class members.
Amen. Dart provides some help. It's under Generative Constructors here:
https://dart.dev/language/constructors
class Point {
// Instance variables to hold
On Thursday, 9 January 2025 at 23:44:52 UTC, WhatMeWorry wrote:
You misspelled the parameter name 'locaction', so your
assignment in the constructor is a no-op:
```
this.location = this.location
```
Thanks. I was starting to question my sanity.
That error is so classic that ev
On Mon, Jan 13, 2025 at 04:05:25AM +, Jim Balter via Digitalmars-d-learn
wrote:
> On Thursday, 9 January 2025 at 22:08:31 UTC, Dennis wrote:
> > On Thursday, 9 January 2025 at 22:01:59 UTC, WhatMeWorry wrote:
> > > this(Location locaction, uint f) {
> > > this.location = location;
On Thursday, 9 January 2025 at 22:08:31 UTC, Dennis wrote:
On Thursday, 9 January 2025 at 22:01:59 UTC, WhatMeWorry wrote:
this(Location locaction, uint f) {
this.location = location;
this.f = f;
}
You misspelled the parameter name 'locaction', so your
assignment in t
On Thursday, 9 January 2025 at 22:08:31 UTC, Dennis wrote:
On Thursday, 9 January 2025 at 22:01:59 UTC, WhatMeWorry wrote:
this(Location locaction, uint f) {
this.location = location;
this.f = f;
}
You misspelled the parameter name 'locaction', so your
assignment in t
struct Node
{
uint multiplier;
Location location;
this(Location locaction, uint multiplier)
{
this.location = location * multiplier;
this.multiplier = multiplier;
}
}
I appreciate your example of the robustness of D, but if I was to
make the same syntax mistake:
this(Loca
On Thursday, 9 January 2025 at 22:01:59 UTC, WhatMeWorry wrote:
produces:
n = Node(Location(0, 0), 33)
when I expected
n = Node(Location(1, 2), 33)
This is a simple typo (it shouldn't be 1 letter) but the code
should be made smarter thanks to the capabilities of D. No more
fear of writing lik
You misspelled the parameter name 'locaction', so your
assignment in the constructor is a no-op:
```
this.location = this.location
```
Thanks. I was starting to question my sanity.
On Thursday, 9 January 2025 at 22:01:59 UTC, WhatMeWorry wrote:
this(Location locaction, uint f) {
this.location = location;
this.f = f;
}
You misspelled the parameter name 'locaction', so your assignment
in the constructor is a no-op:
```
this.location = this.locati
```
import std.stdio;
struct Location {
int r;
int c;
}
struct Node {
this(Location locaction, uint f) {
this.location = location;
this.f = f;
}
Location location;
uint f;
}
void main() {
Node n = Node(Location(1,2), 33);
writeln("n = ", n);
}
--
since i am converting from c# to d :
1. how to check template inheritance
c# code
interface I
class A : I { void run(){}}
class B : A {}
void D\ (T t) : where T:B, new T()
{
t.run();
}
d code
//there should be has several check such as hasBase,
hasImplements on std.traits
void D(T) (int a) if
On Thursday, 31 October 2024 at 09:10:32 UTC, f wrote:
since i am converting from c# to d :
2. how to make built in array , std.container.slist,
container.HashMap (emsi_containers) a range
c# code
void a(IEnumerable\ a) {}
dcode
void a(InputRange!string a) {}
// notworking : i slice it to
On Thursday, 31 October 2024 at 09:10:32 UTC, f wrote:
3. known OAuth / OIDC Api Sdk in D.
there is only Jwt stuff when search code.dlang.org.
https://code.dlang.org/packages/oauth
https://code.dlang.org/packages/vibe-auth
On Tuesday, 29 October 2024 at 20:26:58 UTC, DLearner wrote:
On Tuesday, 29 October 2024 at 18:57:15 UTC, Salih Dincer wrote:
DMD Compiler version?
SDB@79
```
C:\Users\SoftDev>dmd
DMD64 D Compiler v2.106.0-dirty
```
First of all, be sure to get rid of that old version because a
lot has cha
On Wednesday, 30 October 2024 at 15:17:56 UTC, DLearner wrote:
On Wednesday, 30 October 2024 at 09:21:55 UTC, ryuukk_ wrote:
On Tuesday, 29 October 2024 at 20:26:58 UTC, DLearner wrote:
On Tuesday, 29 October 2024 at 18:57:15 UTC, Salih Dincer
wrote:
On Monday, 28 October 2024 at 20:56:03 UTC,
On Wednesday, 30 October 2024 at 09:21:55 UTC, ryuukk_ wrote:
On Tuesday, 29 October 2024 at 20:26:58 UTC, DLearner wrote:
On Tuesday, 29 October 2024 at 18:57:15 UTC, Salih Dincer
wrote:
On Monday, 28 October 2024 at 20:56:03 UTC, DLearner wrote:
Just trying ImportC under Windows 10:
```c
#in
On Tuesday, 29 October 2024 at 20:26:58 UTC, DLearner wrote:
On Tuesday, 29 October 2024 at 18:57:15 UTC, Salih Dincer wrote:
On Monday, 28 October 2024 at 20:56:03 UTC, DLearner wrote:
Just trying ImportC under Windows 10:
```c
#include
int main()
{
printf("Hello world.\n");
return 0;
On Tuesday, 29 October 2024 at 16:14:22 UTC, DLearner wrote:
On Tuesday, 29 October 2024 at 15:49:13 UTC, ryuukk_ wrote:
https://learn.microsoft.com/en-us/visualstudio/ide/reference/command-prompt-powershell?view=vs-2022
Similar message from Powershell:
Whether it's CMD/Powershell isn't impo
On Tuesday, 29 October 2024 at 18:57:15 UTC, Salih Dincer wrote:
On Monday, 28 October 2024 at 20:56:03 UTC, DLearner wrote:
Just trying ImportC under Windows 10:
```c
#include
int main()
{
printf("Hello world.\n");
return 0;
}
```
Produces
```
dmd hello.c
failed launching cl.exe /P /Zc
On Monday, 28 October 2024 at 20:56:03 UTC, DLearner wrote:
Just trying ImportC under Windows 10:
```c
#include
int main()
{
printf("Hello world.\n");
return 0;
}
```
Produces
```
dmd hello.c
failed launching cl.exe /P /Zc:preprocessor /PD /nologo hello.c
/FIC:\D\dmd2\windows\bin64\..\.
On Tuesday, 29 October 2024 at 18:17:37 UTC, Richard (Rikki)
Andrew Cattermole wrote:
https://issues.dlang.org/show_bug.cgi?id=24308
I guess that explains why I've never run into the issue - I've
been using LDC but not DMD on Windows.
https://issues.dlang.org/show_bug.cgi?id=24308
On Tuesday, 29 October 2024 at 16:14:22 UTC, DLearner wrote:
On Tuesday, 29 October 2024 at 15:49:13 UTC, ryuukk_ wrote:
On Tuesday, 29 October 2024 at 15:14:24 UTC, DLearner wrote:
On Tuesday, 29 October 2024 at 12:42:49 UTC, Lance Bachmeier
wrote:
On Tuesday, 29 October 2024 at 12:23:06 UTC,
On 30/10/2024 1:23 AM, DLearner wrote:
On Tuesday, 29 October 2024 at 00:10:17 UTC, Richard (Rikki) Andrew
Cattermole wrote:
https://github.com/dlang/dmd/blob/
dbba866c71db5e1222a1b631b3e910f1a0811732/compiler/src/dmd/link.d#L1332
cl.exe comes from Visual Studio (MSVC).
If you haven't got it
On Tuesday, 29 October 2024 at 15:49:13 UTC, ryuukk_ wrote:
On Tuesday, 29 October 2024 at 15:14:24 UTC, DLearner wrote:
On Tuesday, 29 October 2024 at 12:42:49 UTC, Lance Bachmeier
wrote:
On Tuesday, 29 October 2024 at 12:23:06 UTC, DLearner wrote:
However, there is still a problem:
```
dmd
On Tuesday, 29 October 2024 at 15:14:24 UTC, DLearner wrote:
On Tuesday, 29 October 2024 at 12:42:49 UTC, Lance Bachmeier
wrote:
On Tuesday, 29 October 2024 at 12:23:06 UTC, DLearner wrote:
However, there is still a problem:
```
dmd hello.c
C:\D\dmd2\windows\bin64\..\..\src\druntime\import\imp
On Tuesday, 29 October 2024 at 12:42:49 UTC, Lance Bachmeier
wrote:
On Tuesday, 29 October 2024 at 12:23:06 UTC, DLearner wrote:
However, there is still a problem:
```
dmd hello.c
C:\D\dmd2\windows\bin64\..\..\src\druntime\import\importc.h(134): fatal error
C1034: sal.h: no include path set
Er
On Tuesday, 29 October 2024 at 12:23:06 UTC, DLearner wrote:
However, there is still a problem:
```
dmd hello.c
C:\D\dmd2\windows\bin64\..\..\src\druntime\import\importc.h(134): fatal error
C1034: sal.h: no include path set
Error: C preprocess command cl.exe failed for file hello.c,
exit statu
On Tuesday, 29 October 2024 at 00:10:17 UTC, Richard (Rikki)
Andrew Cattermole wrote:
https://github.com/dlang/dmd/blob/dbba866c71db5e1222a1b631b3e910f1a0811732/compiler/src/dmd/link.d#L1332
cl.exe comes from Visual Studio (MSVC).
If you haven't got it installed, that'll be why.
Otherwise its
https://github.com/dlang/dmd/blob/dbba866c71db5e1222a1b631b3e910f1a0811732/compiler/src/dmd/link.d#L1332
cl.exe comes from Visual Studio (MSVC).
If you haven't got it installed, that'll be why.
Otherwise its related to dmd not being able to find it.
Just trying ImportC under Windows 10:
```
#include
int main()
{
printf("Hello world.\n");
return 0;
}
```
Produces
```
dmd hello.c
failed launching cl.exe /P /Zc:preprocessor /PD /nologo hello.c
/FIC:\D\dmd2\windows\bin64\..\..\src\druntime\import\importc.h
/Fihello.i
Error: C preproces
On Tuesday, 2 April 2024 at 18:21:58 UTC, Mike Shah wrote:
An easier fix may be perhaps to just use 'dub' and install the
glfw dependency. In my talk, I did everything from scratch (my
preferred way), though I suspect using dub with glfw-d
(https://code.dlang.org/packages/glfw-d) may provide le
On Monday, 1 April 2024 at 21:23:50 UTC, WhatMeWorry wrote:
Huge fan of Mike Shah's YouTube videos regarding D and his
latest for D conference:
https://mshah.io/conf/24/DConf%20%20Online%202024%20_%20The%20Case%20for%20Graphics%20Programming%20in%20Dlang.pdf
So I installed github desktop app
On Monday, 1 April 2024 at 21:23:50 UTC, WhatMeWorry wrote:
Huge fan of Mike Shah's YouTube videos regarding D and his
latest for D conference:
https://mshah.io/conf/24/DConf%20%20Online%202024%20_%20The%20Case%20for%20Graphics%20Programming%20in%20Dlang.pdf
So I installed github desktop app
Huge fan of Mike Shah's YouTube videos regarding D and his latest
for D conference:
https://mshah.io/conf/24/DConf%20%20Online%202024%20_%20The%20Case%20for%20Graphics%20Programming%20in%20Dlang.pdf
So I installed github desktop app and cloned his Talks repo.
There is a build command commen
On Monday, 4 March 2024 at 18:08:52 UTC, Andy Valencia wrote:
For any other newbie dlang voyagers, here's a version which
works as expected using the system memory allocator. On my
little i7 I get 1.48 secs wallclock with 5.26 CPU seconds.
...
Using a technique I found in a unit test in std/
On Monday, 4 March 2024 at 16:02:50 UTC, Andy Valencia wrote:
On Monday, 4 March 2024 at 03:42:48 UTC, Richard (Rikki) Andrew
Cattermole wrote:
... I still hope to be able to share memory between spawned
threads, and if it isn't a shared ref of a shared variable,
then what would it be? Do I ha
On Monday, 4 March 2024 at 16:02:50 UTC, Andy Valencia wrote:
On Monday, 4 March 2024 at 03:42:48 UTC, Richard (Rikki) Andrew
Cattermole wrote:
A way to do this without spawning threads manually:
...
Thank you! Of course, a thread dispatch per atomic increment
is going to be s.l.o.w., so not
On Monday, 4 March 2024 at 03:42:48 UTC, Richard (Rikki) Andrew
Cattermole wrote:
A way to do this without spawning threads manually:
...
Thank you! Of course, a thread dispatch per atomic increment is
going to be s.l.o.w., so not surprising you had to trim the
iterations.
Bug I still hope
A way to do this without spawning threads manually:
```d
import std.parallelism : TaskPool, parallel, taskPool, defaultPoolThreads;
import std.stdio : writeln;
import std.range : iota;
enum NSWEPT = 1_000_000;
enum NCPU = 4;
void main() {
import core.atomic : atomicLoad, atomicOp;
shar
I tried a shared memory parallel increment. Yes, it's basically
a cache line thrasher, but I wanted to see what's involved in
shared memory programming. Even though I tried to follow all the
rules to make true shared memory (not thread local) it appears I
failed, as the wait loop at the end o
This is the type defined from c code import by importC:
```c
struct A {
int count;
int[] i;
}
```
This kind data need to be init as const to avoid runtime cost,
and need to be done from D code.
how can I do this ?
To put code into D source, I can use "-i=package" to
automatically
On Wednesday, 13 December 2023 at 12:49:14 UTC, fred wrote:
a bug ?
It helps if you explain what you're talking about so we don't
have to guess.
I tried the code on my computer and it worked fine. But then
figuring, you must be saying something doesn't work right, I
tried it on another com
On Wednesday, 13 December 2023 at 12:49:14 UTC, fred wrote:
[...]
a bug ?
thanks anyway
Try to define the flag as static
```d
static shared(bool) isDone = false;
```
I dont know if that should be a compiler error to have local
shared (I tend to think yes as locals are specific to a frame,
i
import core.thread;
import std.concurrency;
import std.stdio : w = writeln;
void w2(shared(bool) *done)
{
while (*done == false)
{
Thread.sleep(100.msecs);
w("print done? ", *done);
}
}
void s2()
{
shared(bool) i
On Tuesday, 28 November 2023 at 18:43:37 UTC, Adam D Ruppe wrote:
On Tuesday, 28 November 2023 at 18:41:49 UTC, DLearner wrote:
A* A_Ptr;
struct B {
int BFld2;
typeof(A_Ptr)[0..($-1)] ASUB; // Idea is ASUB of type A,
from A_Ptr of type A*.
I think what you really want is
typeof(*A_Pt
On Tuesday, 28 November 2023 at 18:41:49 UTC, DLearner wrote:
A* A_Ptr;
struct B {
int BFld2;
typeof(A_Ptr)[0..($-1)] ASUB; // Idea is ASUB of type A,
from A_Ptr of type A*.
I think what you really want is
typeof(*A_Ptr) ASUB;
the typeof thing returns the type you'd get from the cod
Trying to manipulate 'typeof' return strings, preferably at
compile-time.
e.g. to produce struct B below (intended to have an A
sub-struct), from A_Ptr alone.
```
struct A {
int AFld1;
}
A* A_Ptr;
struct B {
int BFld2;
typeof(A_Ptr)[0..($-1)] ASUB; // Idea is ASUB of type A, from
A_
On Wednesday, 1 November 2023 at 20:49:16 UTC, Zz wrote:
Hi,
Currently using std.csv and would like to do the following
using mir.csv.
auto data = std.csv.csvReader!Layout(input).array;
Are there any examples out there on using mir.csv?
Regards,
Zz
you can find some examples in source cod
Hi,
Currently using std.csv and would like to do the following using
mir.csv.
auto data = std.csv.csvReader!Layout(input).array;
Are there any examples out there on using mir.csv?
Regards,
Zz
On Sunday, 21 May 2023 at 11:20:30 UTC, ag0aep6g wrote:
On 21.05.23 12:55, Theo wrote:
As for the other part, if I use an abstract base class, I
*must* indicate when i'm overriding the base class method by
explicately saying 'override'.
I wouldn't mind if implementing interface methods requir
On 21.05.23 12:55, Theo wrote:
As for the other part, if I use an abstract base class, I *must*
indicate when i'm overriding the base class method by explicately saying
'override'.
I wouldn't mind if implementing interface methods required `override` as
well. I don't know if there is a ration
On Sunday, 21 May 2023 at 10:33:07 UTC, ag0aep6g wrote:
On 21.05.23 12:28, ag0aep6g wrote:
Since @trusted functions are guaranteed (by the programmer) to
be safe, they are allowed to overload/implement @safe
functions/prototypes.
*override
oh ok. so i can override a @safe interface method w
On 21.05.23 12:28, ag0aep6g wrote:
Since @trusted functions are guaranteed (by the programmer)
to be safe, they are allowed to overload/implement @safe
functions/prototypes.
*override
On 21.05.23 11:55, Theo wrote:
class MerchantShip : Ship
{
private int speed = 0; // If only I had 'private(this)' !!
// how do I know this method is actually an implementation of an
interface method
// and not a method specific to this class?
// AND ... how come I can chan
see comments in the code below. they are my questions.
But feel free to ignore the comment about 'private(this)' ;-)
interface Ship
{
@safe void setSpeed(int speed);
@safe int getSpeed();
}
class PirateShip : Ship
{
private int speed = 0; // If only I had 'private(this)' !!
//
On Monday, 1 May 2023 at 03:53:24 UTC, Cecil Ward wrote:
On Wednesday, 26 April 2023 at 23:07:39 UTC, WhatMeWorry wrote:
[...]
Correction: I can’t count. There are only two instructions in
parallel with another pair running alongside, not three. The
first reg, reg move counts as zero cycle
On Wednesday, 26 April 2023 at 23:07:39 UTC, WhatMeWorry wrote:
On Wednesday, 26 April 2023 at 23:02:07 UTC, Richard (Rikki)
Andrew Cattermole wrote:
Don't forget ``num % 2 == 0``.
None should matter, pretty much all production compilers
within the last 30 years should recognize all forms of t
On 27/04/2023 11:07 AM, WhatMeWorry wrote:
On Wednesday, 26 April 2023 at 23:02:07 UTC, Richard (Rikki) Andrew
Cattermole wrote:
Don't forget ``num % 2 == 0``.
None should matter, pretty much all production compilers within the
last 30 years should recognize all forms of this and do the right
On Wed, Apr 26, 2023 at 11:07:39PM +, WhatMeWorry via Digitalmars-d-learn
wrote:
> On Wednesday, 26 April 2023 at 23:02:07 UTC, Richard (Rikki) Andrew
> Cattermole wrote:
> > Don't forget ``num % 2 == 0``.
> >
> > None should matter, pretty much all production compilers within the
> > last 30
On Wednesday, 26 April 2023 at 23:02:07 UTC, Richard (Rikki)
Andrew Cattermole wrote:
Don't forget ``num % 2 == 0``.
None should matter, pretty much all production compilers within
the last 30 years should recognize all forms of this and do the
right thing.
Thanks. Fastest reply ever! And I
Don't forget ``num % 2 == 0``.
None should matter, pretty much all production compilers within the last
30 years should recognize all forms of this and do the right thing.
I just need an even/odd functionality. Don't think D has a
built-in operator.
// Found this C code online.
int isEven(int num)
{
return !(num & 1);
}
// found this in std.functional.unaryFun
alias isEven = unaryFun!("(a & 1) == 0");
assert(isEven(2) && !isEven(1));
If int
On Friday, 13 January 2023 at 05:17:59 UTC, thebluepandabear
wrote:
(Sorry if this is a duplicate.)
If I have the following code inside of a module:
```D
class Obj {
private {
string name = "Hi";
}
}
class ObjDerived : Obj {
}
```
Is it best practice to define `ObjDerived` in
(Sorry if this is a duplicate.)
If I have the following code inside of a module:
```D
class Obj {
private {
string name = "Hi";
}
}
class ObjDerived : Obj {
}
```
Is it best practice to define `ObjDerived` inside another module,
since `ObjDerived` can still access the members
typeof(screen.output.findSplit("")) s;
Perfect. That was the "essence" of my question. But thanks to
Ali, I don't have to use such esoteric syntax. D is a wonderful
language, but I seem to shoot myself in the foot :)
On 10/25/22 6:07 PM, WhatMeWorry wrote:
I'm naturally getting a undefined identifier `s` error in the return.
Is there some way to refactor my code? I tried to declare s outside of
the else brackets like:
auto screen = executeShell(cmdLine);
auto s;
...
{
s = screen.output.findSplit("RE
On 10/25/22 15:07, WhatMeWorry wrote:
> auto screen = executeShell(cmdLine);
> auto s;
That can't work because there is no information to infer the type of
's'. Judging from the return type of getPath, perhaps it's string[]:
string[] s;
This is the question we
I'm naturally getting a undefined identifier `s` error in the
return. Is there some way to refactor my code? I tried to
declare s outside of the else brackets like:
auto screen = executeShell(cmdLine);
auto s;
...
{
s = screen.output.findSplit("REG_SZ");
}
but that doesn't compile either
On Sunday, 23 October 2022 at 17:36:25 UTC, Paul Backus wrote:
On Sunday, 23 October 2022 at 13:32:44 UTC, matheus wrote:
...
You say your idea is "like passing some argument", so why not
actually pass an argument?
For example:
...
Hi, thanks for the example, and yes I'd like to do that,
1 - 100 of 1062 matches
Mail list logo