On Friday, September 22, 2017 08:19:32 Steven Schveighoffer via Digitalmars-
d wrote:
> On 9/22/17 3:55 AM, Dominikus Dittes Scherkl wrote:
> > On Thursday, 21 September 2017 at 13:58:14 UTC, Timon Gehr wrote:
> >> On 21.09.2017 12:33, Per Nordlöw wrote:
> >>> On Wednesday, 20 September 2017 at
On 9/22/17 3:55 AM, Dominikus Dittes Scherkl wrote:
On Thursday, 21 September 2017 at 13:58:14 UTC, Timon Gehr wrote:
On 21.09.2017 12:33, Per Nordlöw wrote:
On Wednesday, 20 September 2017 at 18:41:51 UTC, Timon Gehr wrote:
Can that be done without breakages? -- Andrei
No.
Are thinking
On Thursday, 21 September 2017 at 13:58:14 UTC, Timon Gehr wrote:
On 21.09.2017 12:33, Per Nordlöw wrote:
On Wednesday, 20 September 2017 at 18:41:51 UTC, Timon Gehr
wrote:
Can that be done without breakages? -- Andrei
No.
Are thinking about
typeof([1,2])
changing from
int[]
On Wednesday, 20 September 2017 at 16:34:36 UTC, Andrei
Alexandrescu wrote:
On 09/20/2017 08:36 AM, jmh530 wrote:
On Wednesday, 20 September 2017 at 12:10:47 UTC, Andrei
Alexandrescu wrote:
How would this be useful? -- Andrei
Really just an additional convenience, instead of writing
On 21.09.2017 12:33, Per Nordlöw wrote:
On Wednesday, 20 September 2017 at 18:41:51 UTC, Timon Gehr wrote:
Can that be done without breakages? -- Andrei
No.
Are thinking about
typeof([1,2])
changing from
int[]
to
int[2]
?
Yes, and everything that entails, for example:
On 9/20/17 1:33 PM, ag0aep6g wrote:
On 09/20/2017 06:55 PM, Steven Schveighoffer wrote:
On 9/20/17 11:48 AM, Dgame wrote:
[...]
Unqual!T[n] s(T, size_t n)(T[n] arr)
{
return arr;
}
auto a = "hallo".s;
writeln(typeof(a).stringof); // char[5]
[...]
Still it can't handle the
On Wednesday, 20 September 2017 at 18:41:51 UTC, Timon Gehr wrote:
Can that be done without breakages? -- Andrei
No.
Are thinking about
typeof([1,2])
changing from
int[]
to
int[2]
?
On 20.09.2017 18:34, Andrei Alexandrescu wrote:
I do strongly disagree with this approach, rather we should type array
literals as static arrays by default and rely on implicit conversion
to slices.
Can that be done without breakages? -- Andrei
No.
On 09/20/2017 06:55 PM, Steven Schveighoffer wrote:
On 9/20/17 11:48 AM, Dgame wrote:
[...]
Unqual!T[n] s(T, size_t n)(T[n] arr)
{
return arr;
}
auto a = "hallo".s;
writeln(typeof(a).stringof); // char[5]
[...]
Still it can't handle the case of:
ubyte[3] x = [1, 2, 3];
On 9/20/17 11:48 AM, Dgame wrote:
Works:
char[5] b = "hallo".s;
Sure, but completely misses the point!
Otherwise you could simply use Unqual:
Unqual!T[n] s(T, size_t n)(T[n] arr)
{
return arr;
}
auto a = "hallo".s;
writeln(typeof(a).stringof); // char[5]
This
On 09/20/2017 08:36 AM, jmh530 wrote:
On Wednesday, 20 September 2017 at 12:10:47 UTC, Andrei Alexandrescu wrote:
How would this be useful? -- Andrei
Really just an additional convenience, instead of writing slice[0..$,
0..$, 0..$, i], you would write slice[.., .., .., i].
The result
On 09/20/2017 08:41 AM, Stefan Koch wrote:
On Wednesday, 20 September 2017 at 12:08:45 UTC, Andrei Alexandrescu wrote:
On 09/20/2017 07:49 AM, Jonathan M Davis wrote:
On Wednesday, September 20, 2017 10:59:56 Per Nordlöw via Digitalmars-d
wrote:
On Wednesday, 20 September 2017 at 09:13:52
On Wednesday, 20 September 2017 at 14:15:30 UTC, Steven
Schveighoffer wrote:
On 9/20/17 3:12 AM, Dgame wrote:
http://p0nce.github.io/d-idioms/#@nogc-Array-Literals:-Breaking-the-Limits
This is plain stack corruption, you should fix that. The s
template seems useful, but still I can't get
On 9/20/17 3:12 AM, Dgame wrote:
http://p0nce.github.io/d-idioms/#@nogc-Array-Literals:-Breaking-the-Limits
This is plain stack corruption, you should fix that. The s template
seems useful, but still I can't get my use case to work with it:
T[n] s(T, size_t n)(auto ref T[n] array) pure
On 9/20/17 1:36 AM, Andrei Alexandrescu wrote:
On 9/19/17 8:47 PM, Steven Schveighoffer wrote:
This needs to happen.
e.g.:
char[$] arr = "hello"; // syntax up for debate, but I like this.
I can't think of a correct way to do this that doesn't heap-allocate
and is DRY.
D is so powerful,
On Wednesday, September 20, 2017 12:59:02 Meta via Digitalmars-d wrote:
> On Wednesday, 20 September 2017 at 12:41:57 UTC, Stefan Koch
>
> wrote:
> > On Wednesday, 20 September 2017 at 12:08:45 UTC, Andrei
> >
> > Alexandrescu wrote:
> >> On 09/20/2017 07:49 AM, Jonathan M Davis wrote:
> >>> On
On Wednesday, 20 September 2017 at 12:41:57 UTC, Stefan Koch
wrote:
On Wednesday, 20 September 2017 at 12:08:45 UTC, Andrei
Alexandrescu wrote:
On 09/20/2017 07:49 AM, Jonathan M Davis wrote:
On Wednesday, September 20, 2017 10:59:56 Per Nordlöw via
Digitalmars-d
wrote:
On Wednesday, 20
On Wednesday, 20 September 2017 at 12:08:45 UTC, Andrei
Alexandrescu wrote:
On 09/20/2017 07:49 AM, Jonathan M Davis wrote:
On Wednesday, September 20, 2017 10:59:56 Per Nordlöw via
Digitalmars-d
wrote:
On Wednesday, 20 September 2017 at 09:13:52 UTC, Jonathan M
Davis
wrote:
On Wednesday, 20 September 2017 at 12:10:47 UTC, Andrei
Alexandrescu wrote:
How would this be useful? -- Andrei
Really just an additional convenience, instead of writing
slice[0..$, 0..$, 0..$, i], you would write slice[.., .., .., i].
On 09/19/2017 11:05 PM, jmh530 wrote:
On Wednesday, 20 September 2017 at 02:46:53 UTC, Meta wrote:
[snip]
I also favor making arr[..] equivalent to arr[0..$]
How would this be useful? -- Andrei
On 09/20/2017 07:49 AM, Jonathan M Davis wrote:
On Wednesday, September 20, 2017 10:59:56 Per Nordlöw via Digitalmars-d
wrote:
On Wednesday, 20 September 2017 at 09:13:52 UTC, Jonathan M Davis
wrote:
https://issues.dlang.org/show_bug.cgi?id=12625
- Jonathan M Davis
Looks like we should we
On Wednesday, September 20, 2017 10:59:56 Per Nordlöw via Digitalmars-d
wrote:
> On Wednesday, 20 September 2017 at 09:13:52 UTC, Jonathan M Davis
>
> wrote:
> > https://issues.dlang.org/show_bug.cgi?id=12625
> >
> > - Jonathan M Davis
>
> Looks like we should we wait for
>
On Wednesday, 20 September 2017 at 09:13:52 UTC, Jonathan M Davis
wrote:
https://issues.dlang.org/show_bug.cgi?id=12625
- Jonathan M Davis
Looks like we should we wait for
https://github.com/dlang/dmd/pull/7110 to be merged before adding
`s` to druntime.
On Wednesday, September 20, 2017 08:33:34 Nordlöw via Digitalmars-d wrote:
> On Wednesday, 20 September 2017 at 07:38:00 UTC, Jonathan M Davis
>
> wrote:
> > T[n] s(T, size_t n)(auto ref T[n] array) pure nothrow @nogc
> > @safe
> > {
> >
> > return array;
> >
> > }
>
> What about adding `s` to
On Wednesday, 20 September 2017 at 08:39:49 UTC, Dgame wrote:
Maybe even in object.d so that [1, 2, 3].s is possible without
any import. Then it would look like a built-in feature.
Good idea. Even better. I'll cook up a druntime-PR.
On Wednesday, 20 September 2017 at 08:33:34 UTC, Nordlöw wrote:
On Wednesday, 20 September 2017 at 07:38:00 UTC, Jonathan M
Davis wrote:
T[n] s(T, size_t n)(auto ref T[n] array) pure nothrow @nogc
@safe
{
return array;
}
What about adding `s` to std.array in the meanwhile? I wonder
what
On Wednesday, 20 September 2017 at 07:38:00 UTC, Jonathan M Davis
wrote:
T[n] s(T, size_t n)(auto ref T[n] array) pure nothrow @nogc
@safe
{
return array;
}
What about adding `s` to std.array in the meanwhile? I wonder
what Walter says about the static array to slice assignment.
Isn't
On Wednesday, September 20, 2017 07:12:15 Dgame via Digitalmars-d wrote:
> On Wednesday, 20 September 2017 at 05:36:43 UTC, Andrei
>
> Alexandrescu wrote:
> > On 9/19/17 8:47 PM, Steven Schveighoffer wrote:
> >> This needs to happen.
> >>
> >> e.g.:
> >>
> >> char[$] arr = "hello"; // syntax up
On Wednesday, 20 September 2017 at 05:36:43 UTC, Andrei
Alexandrescu wrote:
On 9/19/17 8:47 PM, Steven Schveighoffer wrote:
This needs to happen.
e.g.:
char[$] arr = "hello"; // syntax up for debate, but I like
this.
I can't think of a correct way to do this that doesn't
heap-allocate and
On Wednesday, 20 September 2017 at 00:47:25 UTC, Steven
Schveighoffer wrote:
This needs to happen.
e.g.:
char[$] arr = "hello"; // syntax up for debate, but I like this.
Yes, hope to see this one day as a language feature, not a
library solution. --Ilya
On Wednesday, September 20, 2017 01:36:43 Andrei Alexandrescu via
Digitalmars-d wrote:
> On 9/19/17 8:47 PM, Steven Schveighoffer wrote:
> > This needs to happen.
> >
> > e.g.:
> >
> > char[$] arr = "hello"; // syntax up for debate, but I like this.
> >
> > I can't think of a correct way to do
On 9/19/17 8:47 PM, Steven Schveighoffer wrote:
This needs to happen.
e.g.:
char[$] arr = "hello"; // syntax up for debate, but I like this.
I can't think of a correct way to do this that doesn't heap-allocate and
is DRY.
D is so powerful, it's a huge shame it can't figure this one out.
On 9/19/17 10:46 PM, Meta wrote:
With all due respect to Andrei, I think he overreacted a bit and it was
a mistake to revert static array length deduction (although the array/aa
type deduction on steroids was probably overly complicated so that was a
good call). Maybe now that @nogc and
On Wednesday, 20 September 2017 at 02:46:53 UTC, Meta wrote:
[snip]
I also favor making arr[..] equivalent to arr[0..$] and allowing
overloading of \ (for inverse, similar syntax as Matlab).
On Wednesday, 20 September 2017 at 01:29:39 UTC, Jonathan M Davis
wrote:
On Tuesday, September 19, 2017 20:47:25 Steven Schveighoffer
via Digitalmars-d wrote:
This needs to happen.
e.g.:
char[$] arr = "hello"; // syntax up for debate, but I like
this.
I can't think of a correct way to do
On Tuesday, September 19, 2017 20:47:25 Steven Schveighoffer via
Digitalmars-d wrote:
> This needs to happen.
>
> e.g.:
>
> char[$] arr = "hello"; // syntax up for debate, but I like this.
>
> I can't think of a correct way to do this that doesn't heap-allocate and
> is DRY.
>
> D is so powerful,
This needs to happen.
e.g.:
char[$] arr = "hello"; // syntax up for debate, but I like this.
I can't think of a correct way to do this that doesn't heap-allocate and
is DRY.
D is so powerful, it's a huge shame it can't figure this one out.
issue:
37 matches
Mail list logo