On Wednesday, 3 April 2024 at 21:57:00 UTC, Liam McGillivray
wrote:
Alright. I suppose that some of the optimization decisions I
have made so far may have resulted in less readable code for
little performance benefit. Now I'm trying to worry less about
optimization. Everything has been very
On Wed, Apr 03, 2024 at 09:57:00PM +, Liam McGillivray via
Digitalmars-d-learn wrote:
> On Friday, 29 March 2024 at 01:18:22 UTC, H. S. Teoh wrote:
> > Take a look at the docs for core.memory.GC. There *is* a method
> > GC.free that you can use to manually deallocate GC-a
On Saturday, 6 April 2024 at 12:05:56 UTC, Jonathan M Davis wrote:
Actually, since I'm usually the one who does the FreeBSD ones
anyway, here you go:
https://github.com/dlang/dmd/pull/16359
The declarations compile, and they should match the ones in C,
since I copied them over and then
Actually, since I'm usually the one who does the FreeBSD ones anyway, here
you go:
https://github.com/dlang/dmd/pull/16359
The declarations compile, and they should match the ones in C, since I
copied them over and then tweaked them, but I haven't actually tested them.
All that being said, even
On Saturday, April 6, 2024 3:57:46 AM MDT Arjan via Digitalmars-d-learn wrote:
> I'm using posix mqueue in a D application on Linux. Works fine.
> But on FreeBSD it fails to compile due to the version statement:
>
> [version (CRuntime_Glibc):](
> https://github.com
On Saturday, 6 April 2024 at 09:21:34 UTC, rkompass wrote:
I checked:
```d
import std.stdio,
std.range,
std.algorithm;
struct N(T)
{
T last, step, first;
bool empty() => first >= last;
T front() => first;
auto popFront() => first += step;
}
void main() {
auto r1 =
On Friday, 5 April 2024 at 21:26:10 UTC, Salih Dincer wrote:
On Friday, 5 April 2024 at 21:16:42 UTC, rkompass wrote:
In the first example the int's are converted to doubles (also
common type).
But they appear as int's because writeln does not write a
trailing .0.
But it doesn't work as
On Friday, April 5, 2024 3:11:42 AM MDT Dom DiSc via Digitalmars-d-learn
wrote:
> On Sunday, 24 March 2024 at 09:16:20 UTC, Jonathan M Davis wrote:
> > So, yes, you've run into a problem that it would be nice to
> > have a better fix for, but even if we could negate attributes
On Friday, 5 April 2024 at 14:41:12 UTC, Carl Sturtivant wrote:
On Friday, 5 April 2024 at 07:37:20 UTC, Paolo Invernizzi wrote:
pragma(msg, x) ?
No.
`__ctfeWrite(x)` is executed inside an executing function like
any other statement in it, and can have an argument `x`
computed during that
On Friday, 5 April 2024 at 21:16:42 UTC, rkompass wrote:
In the first example the int's are converted to doubles (also
common type).
But they appear as int's because writeln does not write a
trailing .0.
But it doesn't work as you say! I even tried it on an older
version and got the same
On Friday, 5 April 2024 at 16:05:20 UTC, H. S. Teoh wrote:
On Fri, Apr 05, 2024 at 03:18:09PM +, Salih Dincer via
Digitalmars-d-learn wrote:
Hi everyone,
Technically r1 and r2 are different types of range. Isn't it
inconsistent to chain both? If not, why is the char type
converted to int
On Friday, 5 April 2024 at 16:05:20 UTC, H. S. Teoh wrote:
On Fri, Apr 05, 2024 at 03:18:09PM +, Salih Dincer via
Digitalmars-d-learn wrote:
Hi everyone,
Technically r1 and r2 are different types of range. Isn't it
inconsistent to chain both? If not, why is the char type
converted to int
On Fri, Apr 05, 2024 at 03:18:09PM +, Salih Dincer via Digitalmars-d-learn
wrote:
> Hi everyone,
>
> Technically r1 and r2 are different types of range. Isn't it
> inconsistent to chain both? If not, why is the char type converted to
> int?
[...]
It's not inconsistent
Hi everyone,
Technically r1 and r2 are different types of range. Isn't it
inconsistent to chain both? If not, why is the char type
converted to int?
```d
import std.stdio,
std.range;
void main() {
auto r1 = N!size_t(10, 1, 1);
auto r2 = N!real(15, .5, 10);
On Friday, 5 April 2024 at 07:37:20 UTC, Paolo Invernizzi wrote:
pragma(msg, x) ?
No.
`__ctfeWrite(x)` is executed inside an executing function like
any other statement in it, and can have an argument `x` computed
during that execution.
It is defined to output the computed text `x` to
On Thursday, 4 April 2024 at 14:29:56 UTC, WhatMeWorry wrote:
Error: Unresolvable dependencies to package bindbc-loader:
bindbc-opengl 0.13.0 depends on bindbc-loader ~>0.3.0
bindbc-sdl 1.4.7 depends on bindbc-loader ~>1.1.0
Please update `bindbc-opengl` to `1.1.0`. I think it's
On Sunday, 24 March 2024 at 09:16:20 UTC, Jonathan M Davis wrote:
So, yes, you've run into a problem that it would be nice to
have a better fix for, but even if we could negate attributes
in general, there are good reasons to prefer to avoid
mass-applying attributes.
I don't see it as
On Thursday, 4 April 2024 at 15:43:55 UTC, Carl Sturtivant wrote:
On Thursday, 4 April 2024 at 15:07:21 UTC, Richard (Rikki)
Andrew Cattermole wrote:
Ah yes, I forgot about that particular thing, doesn't see much
use as far as I'm aware.
It should be working though.
```D
enum X =
On Thursday, 4 April 2024 at 21:23:00 UTC, user1234 wrote:
On Thursday, 4 April 2024 at 19:56:50 UTC, Ferhat Kurtulmuş
wrote:
[...]
```d
module runnable;
import std.stdio : writeln;
import std.range : chain;
void main() @nogc
{
auto s = chain("as ", "df ", "j"); // s is lazy
On Thursday, 4 April 2024 at 19:56:50 UTC, Ferhat Kurtulmuş wrote:
My favorite d feature is lazy ranges. No allocation here.
```d
auto s = chain("as ", "df ", "j"); // s is lazy
writeln(s);
```
```d
import std.range : chain;
void main()
{
string word = "hello";
auto noError = chain(word,
On Thursday, 4 April 2024 at 19:56:50 UTC, Ferhat Kurtulmuş wrote:
On Thursday, 4 April 2024 at 18:14:54 UTC, BoQsc wrote:
I'm looking for more readable standard function to add a
**character** literal to a **string**.
The `~` operator is clearly not great while reading a source
code.
I'm
On Thursday, 4 April 2024 at 18:14:54 UTC, BoQsc wrote:
I'm looking for more readable standard function to add a
**character** literal to a **string**.
The `~` operator is clearly not great while reading a source
code.
I'm not here to discuss that. I'm looking for a function inside
standard
On Thursday, 4 April 2024 at 18:14:54 UTC, BoQsc wrote:
I'm looking for more readable standard function to add a
**character** literal to a **string**.
The `~` operator is clearly not great while reading a source
code.
I'm not here to discuss that. I'm looking for a function inside
standard
I'm looking for more readable standard function to add a
**character** literal to a **string**.
The `~` operator is clearly not great while reading a source code.
I'm not here to discuss that. I'm looking for a function inside
standard library.
The function should be straightforward, up to
On Thursday, 4 April 2024 at 15:47:53 UTC, Richard (Rikki) Andrew
Cattermole wrote:
Oh hey!
https://github.com/dlang/dmd/pull/16250
It was implemented literally 2 weeks ago!
Nightly should have it
https://github.com/dlang/dmd/releases/tag/nightly
Good news, thanks...
SDB@79
On Thursday, 4 April 2024 at 15:47:53 UTC, Richard (Rikki) Andrew
Cattermole wrote:
Oh hey!
https://github.com/dlang/dmd/pull/16250
It was implemented literally 2 weeks ago!
Nightly should have it
https://github.com/dlang/dmd/releases/tag/nightly
Wow! Happy that's in. It was a bit
Oh hey!
https://github.com/dlang/dmd/pull/16250
It was implemented literally 2 weeks ago!
Nightly should have it https://github.com/dlang/dmd/releases/tag/nightly
On Thursday, 4 April 2024 at 15:07:21 UTC, Richard (Rikki) Andrew
Cattermole wrote:
Ah yes, I forgot about that particular thing, doesn't see much
use as far as I'm aware.
It should be working though.
```D
enum X = computeX("A message");
string computeX(string msg) {
auto s = "CTFE
On Thursday, 4 April 2024 at 14:06:19 UTC, Richard (Rikki) Andrew
Cattermole wrote:
```d
static assert(0, "message");
```
Or if it is known to be CTFE'd
```d
assert(0, "message");
```
Just a warning, its a one time use only for both.
No other way to do it.
That's ... unfortunate.
Some
On 05/04/2024 4:04 AM, Carl Sturtivant wrote:
On Thursday, 4 April 2024 at 14:06:19 UTC, Richard (Rikki) Andrew
Cattermole wrote:
```d
static assert(0, "message");
```
Or if it is known to be CTFE'd
```d
assert(0, "message");
```
Just a warning, its a one time use only for both.
No other
On 05/04/2024 3:29 AM, WhatMeWorry wrote:
Error: Unresolvable dependencies to package bindbc-loader:
bindbc-opengl 0.13.0 depends on bindbc-loader ~>0.3.0
bindbc-sdl 1.4.7 depends on bindbc-loader ~>1.1.0
https://github.com/BindBC/bindbc-opengl/issues/47
On 05/04/2024 2:54 AM, Carl Sturtivant wrote:
I'm writing CTFE on Windows, latest DMD compiler. How should I write a
message to the console (stderr) from a CTFE function call during
compilation?
```d
static assert(0, "message");
```
Or if it is known to be CTFE'd
```d
assert(0, "message");
Error: Unresolvable dependencies to package bindbc-loader:
bindbc-opengl 0.13.0 depends on bindbc-loader ~>0.3.0
bindbc-sdl 1.4.7 depends on bindbc-loader ~>1.1.0
Hi,
You should have a look at the decorator design pattern, it
reduces the amount of classes to implement if you need to combine
different effects such as elemental damage to your weapons (e.g.
if you want flame arrows).
https://en.wikipedia.org/wiki/Decorator_pattern
For my tactical role-playing game, I want to finally implement
items and weapons. These are objects that a `Unit` object can
make use of. Just as tools are often said to be an extension of
their user, I want items to be an extension of the unit who uses
them. I'm trying to figure out how to
On Wednesday, 3 April 2024 at 00:20:51 UTC, Jonathan M Davis
wrote:
On Monday, April 1, 2024 5:37:56 PM MDT dany via
Digitalmars-d-learn wrote:
Actually I would get an ID's Usb
That's going to depend on the operating system, and it's also
going to depend on exactly what kind of ID you're
On Friday, 29 March 2024 at 01:18:22 UTC, H. S. Teoh wrote:
Take a look at the docs for core.memory.GC. There *is* a
method GC.free that you can use to manually deallocate
GC-allocated memory if you so wish. Keep in mind, though, that
manually managing memory in this way invites
On Monday, April 1, 2024 5:37:56 PM MDT dany via Digitalmars-d-learn wrote:
> Actually I would get an ID's Usb
That's going to depend on the operating system, and it's also going to
depend on exactly what kind of ID you're looking for.
- Jonathan M Davis
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
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
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
On Monday, 1 April 2024 at 18:28:16 UTC, Nick Treleaven wrote:
On Sunday, 31 March 2024 at 23:05:44 UTC, Carl Sturtivant wrote:
Yes, it's not possible to instantiate a function type.
But with extern it seems the semantics is fine as a function
is not being instantiated. It is merely
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
On Sunday, 31 March 2024 at 23:05:44 UTC, Carl Sturtivant wrote:
Yes, it's not possible to instantiate a function type.
But with extern it seems the semantics is fine as a function is
not being instantiated. It is merely associating a name with a
type: in what sense is this instantiation in
I see now.
https://github.com/tim-dlang/dqt
has examples of where these libs are found within Qt itself.
```
Build started at 7:16 PM...
-- Build started: Project: d--, Configuration: debug x64
--
Building
C:\Users\fruit\OneDrive\Desktop\Code\StateMachine\D--\d--.exe...
LINK : fatal error LNK1181: cannot open input file
'Qt5Widgets.lib'
Building
On Monday, 1 April 2024 at 04:54:46 UTC, cc wrote:
I scoured [Traits](https://dlang.org/spec/traits.html) and
[std.traits](https://dlang.org/phobos/std_traits.html) looking
for a simple method to tell whether a member was declared as
enum but couldn't find one, so if anyone knows a proper way
On Thursday, 28 March 2024 at 17:23:39 UTC, Andy Valencia wrote:
I wanted a lightweight and simpler CSV decoder. I won't post
the whole thing, but basically you instantiate one as:
That's pretty much the best way to do it. While `.tupleof` does
look kind of hacky, and you could instead
On Saturday, 30 March 2024 at 05:01:32 UTC, harakim wrote:
On Tuesday, 26 March 2024 at 20:42:00 UTC, Chris Piker wrote:
On Tuesday, 26 March 2024 at 20:19:27 UTC, bachmeier wrote:
Should be able to just use it, as described here:
On Sunday, 31 March 2024 at 11:35:39 UTC, Nick Treleaven wrote:
If a function type does include identifiers, then would two
function types with the same argument types but different
identifiers compare equal using `is`?
Yes. That is the idea. Define `is` to work this way.
Yes, it's not
On Thursday, 28 March 2024 at 01:53:52 UTC, Steven Schveighoffer
wrote:
```d
class Base {}
class Derived : Base {}
@safe pure nothrow unittest {
Base b;
Derived d;
b = d; // pass
Base[] bs;
Derived[] ds;
bs ~= ds; // pass
bs = ds; // fail
On Saturday, 30 March 2024 at 09:35:24 UTC, Per Nordlöw wrote:
Does anybody recognize the error
```
Attribute 'nocapture' does not apply to function return values
%12 = call noalias nocapture align 8 ptr @_D3xxx(ptr nonnull
%10, { i64, ptr } %11) #2, !dbg !7978
Attribute 'nocapture' does
On Saturday, 30 March 2024 at 22:37:53 UTC, Carl Sturtivant wrote:
I'm inclined to a view that keeps more "it just works" options
open. Regard the parameter names as a part of the type (which I
am very grateful for them being currently) and just regard part
of the definition of "type equality"
On Saturday, 30 March 2024 at 22:37:53 UTC, Carl Sturtivant wrote:
Incidentally, I tried
```D
extern typeof(foo) func;
```
to say that func was an actual function (`extern` so defined
elsewhere) whose type was the type of the function `int foo(int
num, string name, int);` so I can then use
On Saturday, 30 March 2024 at 21:07:35 UTC, Nick Treleaven wrote:
Although `.stringof` on a function type does include the
parameter names, the names are not really part of the type -
see:
https://github.com/dlang/phobos/pull/3620#issuecomment-288469685
Perhaps `ParameterIdentifierTuple`
On Saturday, 30 March 2024 at 21:51:34 UTC, Nick Treleaven wrote:
On Saturday, 30 March 2024 at 21:45:34 UTC, Nick Treleaven
wrote:
On Saturday, 30 March 2024 at 21:25:45 UTC, Carl Sturtivant
wrote:
OK, so how can I get them? Am I forced to take that string
and parse it with CTFE?
Lookup the
On Saturday, 30 March 2024 at 21:45:34 UTC, Nick Treleaven wrote:
On Saturday, 30 March 2024 at 21:25:45 UTC, Carl Sturtivant
wrote:
OK, so how can I get them? Am I forced to take that string and
parse it with CTFE?
Lookup the source of ParameterIdentifierTuple and change
On Saturday, 30 March 2024 at 21:25:45 UTC, Carl Sturtivant wrote:
OK, so how can I get them? Am I forced to take that string and
parse it with CTFE?
Lookup the source of ParameterIdentifierTuple and change
`FunctionTypeOf!func` to just `func` inside the first `static if`.
On Saturday, 30 March 2024 at 21:07:35 UTC, Nick Treleaven wrote:
On Saturday, 30 March 2024 at 19:23:07 UTC, Carl Sturtivant
wrote:
$ dmd -c bug1.d
int(int num, string name, int)
["", "", ""]
bug1.d(9): Error: static assert: "wrong!"
```
Please explain. How do I get the names of the
On Saturday, 30 March 2024 at 19:23:07 UTC, Carl Sturtivant wrote:
$ dmd -c bug1.d
int(int num, string name, int)
["", "", ""]
bug1.d(9): Error: static assert: "wrong!"
```
Please explain. How do I get the names of the identifiers out
of a parameter list at compile time reliably?
Although
Using the
[ParameterIdentifierTuple](https://dlang.org/phobos/std_traits.html#ParameterIdentifierTuple) example just there, with one more step stops working. Details:
```D
import std.traits;
int foo(int num, string name, int);
static assert([ParameterIdentifierTuple!foo] == ["num", "name",
Does anybody recognize the error
```
Attribute 'nocapture' does not apply to function return values
%12 = call noalias nocapture align 8 ptr @_D3xxx(ptr nonnull
%10, { i64, ptr } %11) #2, !dbg !7978
Attribute 'nocapture' does not apply to function return values
ptr @_D3xyz1
Attribute
On Saturday, 30 March 2024 at 05:01:32 UTC, harakim wrote:
@D Language Foundation - This is a HUGE selling point. I had to
use cups the other day and I just copied some code from a d
file and linked the library. It was so easy I was suspicious
but it worked. Using C from D is pretty much as
On Saturday, 30 March 2024 at 03:25:02 UTC, matheus wrote:
Interesting!
Matheus.
Yes, it's just a small modification.
On Tuesday, 26 March 2024 at 20:42:00 UTC, Chris Piker wrote:
On Tuesday, 26 March 2024 at 20:19:27 UTC, bachmeier wrote:
Should be able to just use it, as described here:
https://forum.dlang.org/post/qxctappnigkwvaqak...@forum.dlang.org Create a .c file that includes the header files and
On Saturday, 30 March 2024 at 02:11:25 UTC, zjh wrote:
On Friday, 29 March 2024 at 22:50:53 UTC, curiousprogramma08
wrote:
you can use openD.
Wait a minute, they already added this modification into their
language?
Interesting!
Matheus.
On Friday, 29 March 2024 at 22:50:53 UTC, curiousprogramma08
wrote:
you can use openD.
On Friday, 29 March 2024 at 22:50:53 UTC, curiousprogramma08
wrote:
...
If I'm not mistaken, like in classes "private" is module based:
https://wiki.dlang.org/Access_specifiers_and_visibility
Matheus.
On Friday, March 29, 2024 4:50:53 PM MDT curiousprogramma08 via Digitalmars-d-
learn wrote:
> ```d
> struct QueueNode
> {
>
> private int data;
> private QueueNode *next = null;
>
> this(int data)
> {
> this.data = data;
> }
```d
struct QueueNode
{
private int data;
private QueueNode *next = null;
this(int data)
{
this.data = data;
}
}
```
I also tried to write it like this too:
```d
struct QueueNode
{
private:
int data;
QueueNode *next = null;
public:
this(int
On Friday, 29 March 2024 at 00:37:21 UTC, Jonathan M Davis wrote:
On Thursday, March 28, 2024 4:21:03 PM MDT Salih Dincer via
Digitalmars-d- learn wrote:
How can we add all members of an enum type to a list without
duplicating code?
As the documentation for EnumMembers explains, you can use
On Thu, Mar 28, 2024 at 11:49:19PM +, Liam McGillivray via
Digitalmars-d-learn wrote:
> On Thursday, 28 March 2024 at 04:46:27 UTC, H. S. Teoh wrote:
> > The whole point of a GC is that you leave everything up to it to
> > clean up. If you want to manage your own memory, d
On Friday, 29 March 2024 at 00:04:14 UTC, Serg Gini wrote:
On Thursday, 28 March 2024 at 23:15:26 UTC, Salih Dincer wrote:
There is no such thing as parallel programming in D anyway. At
least it has modules, but I didn't see it being works.
Whenever I use toys built in foreach() it always ends
On Thursday, March 28, 2024 4:21:03 PM MDT Salih Dincer via Digitalmars-d-
learn wrote:
> How can we add all members of an enum type to a list without
> duplicating code?
As the documentation for EnumMembers explains, you can use
std.meta.NoDuplicates to strip out duplicates if you want
On Thursday, 28 March 2024 at 23:15:26 UTC, Salih Dincer wrote:
There is no such thing as parallel programming in D anyway. At
least it has modules, but I didn't see it being works. Whenever
I use toys built in foreach() it always ends in disappointment
I think it just works :)
Which issues
On Thursday, 28 March 2024 at 04:46:27 UTC, H. S. Teoh wrote:
The whole point of a GC is that you leave everything up to it
to clean up. If you want to manage your own memory, don't use
the GC. D does not force you to use it; you can import
core.stdc.stdlib and use malloc/free to your heart's
On Thursday, 28 March 2024 at 23:08:54 UTC, rkompass wrote:
You can drop and take from the folded values range.
I got `[1, 0.67, 0.625, 0.619048, 0.618182, 0.618056,
0.618037, 0.618034, 0.618034, 0.618034]` from the above code.
Thank you so much...
I solved the problem: r.back doesn't
On Thursday, 28 March 2024 at 17:50:17 UTC, Salih Dincer wrote:
Hi,
When I use the chunks() template with iota(), for instance,
with chunks(2), I can access both r.front and r.back. However,
in a range of my own type (named iras in the code below), only
r.front is working. I think the error
On Thursday, 28 March 2024 at 20:18:10 UTC, rkompass wrote:
I didn't know that OpenMP programming could be that easy.
Binary size is 16K, same order of magnitude, although somewhat
less.
D advantage is gone here, I would say.
There is no such thing as parallel programming in D anyway. At
On Thursday, 28 March 2024 at 03:54:05 UTC, Salih Dincer wrote:
On Wednesday, 27 March 2024 at 20:50:05 UTC, rkompass wrote:
This works:
I decided to give the full code. Maybe then it will be better
understood what I mean. I actually pointed out the indirect
solution above but it's a bit
On Thu, Mar 28, 2024 at 10:10:43PM +, jms via Digitalmars-d-learn wrote:
> On Thursday, 28 March 2024 at 02:30:11 UTC, jms wrote:
[...]
> I think I figured it out and the difference is probably in the mode.
> This documentation
> https://learn.microsoft.com/en-us/cpp/c-run
On Thursday, 10 August 2023 at 08:33:13 UTC, Christian Köstlin
wrote:
I think one part of the original question (now fanished in the
nntp backup) was how to get all enum members into a list
without duplicating code.
```d
import std.traits : EnumMembers;
import std.stdio : writeln;
import
On Thursday, 28 March 2024 at 02:30:11 UTC, jms wrote:
Why in the below silly program am I reading both the \r and \n
characters when using rawRead in block a, but when looping by 1
byte chunks in block b only appear to be reading the \n
characters?
I'm on Windows 11 using DMD64 D Compiler
On Thursday, 28 March 2024 at 20:18:10 UTC, rkompass wrote:
D advantage is gone here, I would say.
It's hard to compare actually.
Std.parallelism has a bit different mechanics, and I think easier
to use. The syntax is nicer.
OpenMP is an well-known and highly adopted tool, which is also
On Thursday, 28 March 2024 at 14:07:43 UTC, Salih Dincer wrote:
On Thursday, 28 March 2024 at 11:50:38 UTC, rkompass wrote:
Turning back to this: Are there similarly simple libraries for
C, that allow for
parallel computation?
You can achieve parallelism in C using libraries such as
Hi,
When I use the chunks() template with iota(), for instance, with
chunks(2), I can access both r.front and r.back. However, in a
range of my own type (named iras in the code below), only r.front
is working. I think the error given by r.back is not a bug
related to chunks, is it?
```d
On Thu, Mar 28, 2024 at 05:23:39PM +, Andy Valencia via Digitalmars-d-learn
wrote:
[...]
> auto t = T();
> foreach (i, ref val; t.tupleof) {
> static if (is(typeof(val) == int)) {
> val = this.get_int();
> } else {
>
I wanted a lightweight and simpler CSV decoder. I won't post the
whole thing, but basically you instantiate one as:
struct Whatever {
...
}
...
f = File("path.csv", "r");
auto c = CSVreader!Whatever(f);
foreach (rec; c) { ...
CSVreader is, of course, templated:
struct
On Thursday, 28 March 2024 at 11:50:38 UTC, rkompass wrote:
Turning back to this: Are there similarly simple libraries for
C, that allow for
parallel computation?
You can achieve parallelism in C using libraries such as OpenMP,
which provides a set of compiler directives and runtime
On Thursday, 28 March 2024 at 01:09:34 UTC, Salih Dincer wrote:
Good thing you're digressing; I am 45 years old and I still
cannot say that I am finished as a student! For me this is
version 4 and it looks like we don't need a 3rd variable other
than the function parameter and return value:
On Thu, Mar 28, 2024 at 03:56:10AM +, Liam McGillivray via
Digitalmars-d-learn wrote:
[...]
> I may be now starting to see why the use of a garbage collector is
> such a point of contention for D. Not being able to predict how the
> garbage collection process will happen seems lik
On Wednesday, 27 March 2024 at 22:14:16 UTC, H. S. Teoh wrote:
What's the definition of this.map, this.faction, and
this.currentTile?
As was said, and can be found on the linked repository, they are
references to class objects.
On Thursday, 28 March 2024 at 01:47:27 UTC, Steven
On Wednesday, 27 March 2024 at 20:50:05 UTC, rkompass wrote:
This works:
I decided to give the full code. Maybe then it will be better
understood what I mean. I actually pointed out the indirect
solution above but it's a bit ugly and I'm sure there must be a
better way?
```d
import
Why in the below silly program am I reading both the \r and \n
characters when using rawRead in block a, but when looping by 1
byte chunks in block b only appear to be reading the \n
characters?
I'm on Windows 11 using DMD64 D Compiler v2.107.1 if that
matters, but I'm thinking this maybe
On Monday, 25 March 2024 at 07:16:35 UTC, Per Nordlöw wrote:
On Saturday, 23 March 2024 at 11:04:04 UTC, Dmitry Olshansky
wrote:
The first and second is unsound (infamously allowed in Java).
In the general case, yes. But, do you see any errors with the
code
```d
class Base {}
class Derived
On Wednesday, 27 March 2024 at 21:43:48 UTC, Liam McGillivray
wrote:
In my current [game
project](https://github.com/LiamM32/Open_Emblem), [something
strange](https://github.com/LiamM32/Open_Emblem/issues/20) has
happened as of a recent commit. When running `dub test`, all
the unittests
On Wednesday, 27 March 2024 at 08:22:42 UTC, rkompass wrote:
I apologize for digressing a little bit further - just to share
insights to other learners.
Good thing you're digressing; I am 45 years old and I still
cannot say that I am finished as a student! For me this is
version 4 and it
On Wed, Mar 27, 2024 at 09:43:48PM +, Liam McGillivray via
Digitalmars-d-learn wrote:
[...]
> ```
> ~this() {
> this.alive = false;
> if (this.map !is null) this.map.removeUnit(this);
> if (this.faction !is null) this.fac
In my current [game
project](https://github.com/LiamM32/Open_Emblem), [something
strange](https://github.com/LiamM32/Open_Emblem/issues/20) has
happened as of a recent commit. When running `dub test`, all the
unittests appear to pass, but then after the last unittest has
concluded an "Invalid
On Wednesday, 27 March 2024 at 13:38:29 UTC, Salih Dincer wrote:
So, not works this:
```d
fib(1, 1).take(48)
//.array
.chunks(2)
.map!"a[1] / a[0]"
.back
.writeln; // 1.61803
```
Thanks...
SDB@79
This works:
```d
import std.stdio;
import
201 - 300 of 76522 matches
Mail list logo