On Thursday, 20 December 2018 at 01:37:59 UTC, Simón Oroño wrote:
The only difference (code-wise) is the `const` keyword. I've
tried with both `ldc` and `dmd` with same result. Why is the
output different when the variable is `const`?
A const range cannot be iterated by a generic template
I have the following piece of code:
``
#!/bin/env dub
/+ dub.sdl:
name: day2
+/
import std.algorithm.iteration : group;
import std.stdio;
void main() {
const auto a = group("simon");
auto b = group("simon");
writeln(a == b);
writeln();
writeln(a);
On Wed, Dec 19, 2018 at 02:01:28PM -0500, Steven Schveighoffer via
Digitalmars-d-learn wrote:
> On 12/19/18 1:30 PM, H. S. Teoh wrote:
[...]
> > For CTFE, though, we don't really care about calling popFront twice,
> > so I surmise that we should be able to just use the original
> > non-RefCounted
On 12/19/18 1:30 PM, H. S. Teoh wrote:
On Wed, Dec 19, 2018 at 01:19:28PM -0500, Steven Schveighoffer via
Digitalmars-d-learn wrote:
On 12/19/18 12:20 PM, H. S. Teoh wrote:
[...]
It was originally a simple wrapper when I first submitted it, but
Andrei requested to use RefCounted in order to
On Wed, Dec 19, 2018 at 01:19:28PM -0500, Steven Schveighoffer via
Digitalmars-d-learn wrote:
> On 12/19/18 12:20 PM, H. S. Teoh wrote:
[...]
> > It was originally a simple wrapper when I first submitted it, but
> > Andrei requested to use RefCounted in order to work around the
> > subrange
On 12/19/18 12:20 PM, H. S. Teoh wrote:
On Wed, Dec 19, 2018 at 10:38:06AM -0500, Steven Schveighoffer via
Digitalmars-d-learn wrote:
[...]
Looking at the code for chunkBy, it seems to me that the
implementation is quite complex for what in my head should be a simple
wrapper...
[...]
It was
On Wed, Dec 19, 2018 at 10:38:06AM -0500, Steven Schveighoffer via
Digitalmars-d-learn wrote:
[...]
> Looking at the code for chunkBy, it seems to me that the
> implementation is quite complex for what in my head should be a simple
> wrapper...
[...]
It was originally a simple wrapper when I
On Wednesday, 19 December 2018 at 16:31:57 UTC, Andre Pany wrote:
On Wednesday, 19 December 2018 at 14:08:10 UTC, Codifies wrote:
On Wednesday, 19 December 2018 at 13:14:20 UTC, Andre Pany
wrote:
On Wednesday, 19 December 2018 at 12:57:14 UTC, Codifies
wrote:
[...]
You can use dub sub
On Tuesday, 18 December 2018 at 20:33:43 UTC, Rainer Schuetze
wrote:
On 14/12/2018 02:56, Steven Schveighoffer wrote:
On 12/13/18 7:16 PM, Michelle Long wrote:
byte x = 0xF;
ulong y = x >> 60;
Surely you meant x << 60? As x >> 60 is going to be 0, even
with a ulong.
It doesn't work as
On Wednesday, 19 December 2018 at 14:08:10 UTC, Codifies wrote:
On Wednesday, 19 December 2018 at 13:14:20 UTC, Andre Pany
wrote:
On Wednesday, 19 December 2018 at 12:57:14 UTC, Codifies wrote:
[...]
You can use dub sub packages. Each plugin will be a dub
package with its own dub descriptor
On 20/12/2018 5:02 AM, Jonathan M Davis wrote:
On Wednesday, December 19, 2018 1:19:42 AM MST rikki cattermole via
Digitalmars-d-learn wrote:
On 19/12/2018 7:11 PM, Jonathan M Davis wrote:
Really? I would have thought that that would be a pretty obvious
optimization (especially if inlining is
On Wednesday, December 19, 2018 1:19:42 AM MST rikki cattermole via
Digitalmars-d-learn wrote:
> On 19/12/2018 7:11 PM, Jonathan M Davis wrote:
> > Really? I would have thought that that would be a pretty obvious
> > optimization (especially if inlining is enabled).
>
> Assembly doesn't lie.
I'm
On Tuesday, 18 December 2018 at 13:52:29 UTC, Steven
Schveighoffer wrote:
On 12/18/18 6:29 AM, Simen Kjærås wrote:
@safe unittest {
unsafe!({
fun(2);
});
unsafe!fun(2);
}
Wow, I really like this. The only real problem is that one
generally searches for @trusted when
On Wed, 19 Dec 2018 15:12:14 +, bauss wrote:
> That's assuming that it's compile-time data though.
>
> If not then you can't do what you want to do.
>
> What you can do is wrap it in a function in the mixin template which you
> just call after instantiating it.
Or while instantiating it:
On 12/19/18 3:20 AM, Andrey wrote:
Hi,
I have got this code:
import std.array : array;
import std.algorithm.mutation;
import std.algorithm.iteration;
import std.stdio;
void main()
{
string input = "sieviaghp";
enum data = ["emo", "emoze", "emow", "emuo", "evuo", "ete", "ie",
"vuo",
On Wednesday, 19 December 2018 at 15:09:47 UTC, bauss wrote:
On Wednesday, 19 December 2018 at 13:37:17 UTC, Andrey wrote:
Hi,
Here is a template mixin:
mixin template create(alias input, uint index, alias data)
{
if(input.length < index) return;
// ... some code
}
When I try to
On Wednesday, 19 December 2018 at 13:37:17 UTC, Andrey wrote:
Hi,
Here is a template mixin:
mixin template create(alias input, uint index, alias data)
{
if(input.length < index) return;
// ... some code
}
When I try to compile it, I get:
Error: declaration expected, not if
Is it
On Wed, 19 Dec 2018 12:57:14 +, Codifies wrote:
> I could do this with a few simple rules in a Makefile, but I have no
> clue how to achieve this using dub.
If you need dub, you can create a wrapper script that generates the dub
file for the plugins directory.
Make is a lot better for this
On Wednesday, 19 December 2018 at 13:14:20 UTC, Andre Pany wrote:
On Wednesday, 19 December 2018 at 12:57:14 UTC, Codifies wrote:
[...]
You can use dub sub packages. Each plugin will be a dub package
with its own dub descriptor (sdl) file.
For your main dub sdl you set targetType to None.
Mixin templates don't work on statements only declarations like structs.
Hi,
Here is a template mixin:
mixin template create(alias input, uint index, alias data)
{
if(input.length < index) return;
// ... some code
}
When I try to compile it, I get:
Error: declaration expected, not if
Is it possible to mixin operator 'if' directly inside my template
On Wednesday, 19 December 2018 at 12:57:14 UTC, Codifies wrote:
I am currently using this dub.sdl
name"runz80"
targetType "executable"
lflags "libz80/libz80.a"
however I will be creating a number of plugins, each plugin
will consist of a single source file, I'd like the plugin
oh forgot to add just for extra pain while the main
application won't need gtk, most of the plugins will...
I am currently using this dub.sdl
name"runz80"
targetType "executable"
lflags "libz80/libz80.a"
however I will be creating a number of plugins, each plugin will
consist of a single source file, I'd like the plugin source
directory to be separate from main source directory and
On Sunday, 16 December 2018 at 18:37:15 UTC, Marko wrote:
On Amazon The D Programming Language has good reviews but it's
8 years old. So is this book still relevant today?
Yes, I would recommend it. It is meant to be comprehensive but
introductory, so many language or library changes since
Hi,
I have got this code:
import std.array : array;
import std.algorithm.mutation;
import std.algorithm.iteration;
import std.stdio;
void main()
{
string input = "sieviaghp";
enum data = ["emo", "emoze", "emow", "emuo", "evuo", "ete",
"ie", "vuo", "sie", "w"];
enum index = 3;
On 19/12/2018 7:11 PM, Jonathan M Davis wrote:
Really? I would have thought that that would be a pretty obvious
optimization (especially if inlining is enabled).
Assembly doesn't lie.
On Wednesday, 19 December 2018 at 06:11:48 UTC, Jonathan M Davis
wrote:
Really? I would have thought that that would be a pretty
obvious optimization (especially if inlining is enabled). I
suppose that it doesn't entirely surprise me if dmd does a poor
job of it, but I would have expected ldc
On Tuesday, 18 December 2018 at 12:42:12 UTC, rikki cattermole
wrote:
Yes except for ldc with -O3.
ldc with -O2 generates the same code.
29 matches
Mail list logo