On Wednesday, 24 February 2021 at 06:14:58 UTC, Imperatorn wrote:
On Tuesday, 23 February 2021 at 19:44:39 UTC, David wrote:
Not sure if `learn` is the right topic or not to post this..
I've been going through Bob Nystrom's "Crafting Interpreters"
for a bit of fun and over the weekend put toge
On Wed, Feb 24, 2021 at 03:52:57AM +, Kyle Ingraham via Digitalmars-d-learn
wrote:
[...]
> I was under the impression that compile-time or template parameters
> were only for types.
In D, template parameters can take not only types, but almost any type
(provided they are constructible at comp
On Tuesday, 23 February 2021 at 19:44:39 UTC, David wrote:
Not sure if `learn` is the right topic or not to post this..
I've been going through Bob Nystrom's "Crafting Interpreters"
for a bit of fun and over the weekend put together a toy
allocator in D - free and gc not yet done. It's single
On Wednesday, 24 February 2021 at 03:57:37 UTC, Adam D. Ruppe
wrote:
On Wednesday, 24 February 2021 at 03:52:57 UTC, Kyle Ingraham
wrote:
The part that got my attention was `bool isBGR`. I was under
the impression that compile-time or template parameters were
only for types.
No, you can pass
On Wednesday, 24 February 2021 at 03:52:57 UTC, Kyle Ingraham
wrote:
The part that got my attention was `bool isBGR`. I was under
the impression that compile-time or template parameters were
only for types.
No, you can pass almost anything to them.
https://dlang.org/spec/template.html#templat
I was reading the code for the DCV library and came across this
function:
https://github.com/libmir/dcv/blob/master/source/dcv/imgproc/color.d#L128
Here is a shortened form:
[return type] rgbbgr2gray(bool isBGR, V)([run-time
parameters]){[implementation]}
and an example call:
rgbbgr2gray!(tr
On Tue, Feb 23, 2021 at 10:24:50PM +, Mike Brown via Digitalmars-d-learn
wrote:
> Hi all,
>
> Im porting some C++ code, which has a mess of a section that
> implements prime number type id's. I've had to smother it to death
> with test cases to get it reliable, I think metaprogramming that D
Hi all,
Im porting some C++ code, which has a mess of a section that
implements prime number type id's. I've had to smother it to
death with test cases to get it reliable, I think metaprogramming
that D provides is the better solution - Id rather not
reimplement that C++ mess ideally.
A sim
On 2/22/21 2:00 PM, Jack wrote:
> C defValue() { return C.a; }
Yes, putting the expression in a function is the way I know for lazy
evaluation.
Ali
Not sure if `learn` is the right topic or not to post this..
I've been going through Bob Nystrom's "Crafting Interpreters" for
a bit of fun and over the weekend put together a toy allocator in
D - free and gc not yet done. It's single threaded and
unsurprisingly faster than malloc for small ob
On Tuesday, 23 February 2021 at 15:11:32 UTC, Adam D. Ruppe wrote:
On Tuesday, 23 February 2021 at 14:56:45 UTC, Decabytes wrote:
It is often called `ldc2` so give that a try.
btw I run gdc on my raspberry pi 3 from the raspbian distro
package and it is pretty nice too. though ldc will have
On Tuesday, 23 February 2021 at 15:15:56 UTC, Steven
Schveighoffer wrote:
On 2/23/21 9:56 AM, Decabytes wrote:
Found this on the internet:
https://forums.freebsd.org/threads/list-of-the-installed-files-of-a-package.66372/
looks like:
pkg info -l name-of-package
It should show you were it p
On 2/23/21 9:56 AM, Decabytes wrote:
I've been playing around in D for a bit and I'm enjoying it so far. I've
also been testing out freebsd on a Raspberry Pi 3. I noticed that there
is actually a package for LDC on the raspberry pi 3, and thought it
would be fun to play around with D on an ARM
On Tuesday, 23 February 2021 at 14:56:45 UTC, Decabytes wrote:
I installed it with "pkg install ldc", but embarrassingly I'm
not actually sure where the compiler is. ldc isn't a recognized
action on the command line
It is often called `ldc2` so give that a try.
btw I run gdc on my raspberry p
I've been playing around in D for a bit and I'm enjoying it so
far. I've also been testing out freebsd on a Raspberry Pi 3. I
noticed that there is actually a package for LDC on the raspberry
pi 3, and thought it would be fun to play around with D on an ARM
platform.
I installed it with "pkg
On Monday, 22 February 2021 at 13:23:40 UTC, Danny Arends wrote:
On Friday, 19 February 2021 at 15:39:25 UTC, kdevel wrote:
[...]
Perhaps a bit late, but this is how I deal with pipes and
spawnShell.
Read one byte at a time from stdout and stderr:
https://github.com/DannyArends/DaNode/blob/
On Tuesday, 23 February 2021 at 09:21:44 UTC, Imperatorn wrote:
Why does all these pass:
static assert(is(ElementEncodingType!(char[]) == char));
static assert(is(ElementEncodingType!(wstring) ==
immutable(wchar)));
static assert(is(ElementEncodingType!(byte[]) == byte));
static
Why does all these pass:
static assert(is(ElementEncodingType!(char[]) == char));
static assert(is(ElementEncodingType!(wstring) ==
immutable(wchar)));
static assert(is(ElementEncodingType!(byte[]) == byte));
static assert(is(ElementEncodingType!(ubyte[]) == ubyte));
auto ra
18 matches
Mail list logo