On Saturday, 13 June 2015 at 15:21:19 UTC, Dennis Ritchie wrote:
Hello, everyone!
I like to work with arrays of strings like `string[] strArray`,
but unfortunately, they are immutable.
I do not like to work with arrays of strings such as `char[][]
strArray`, because it is necessary to apply
On Saturday, 13 June 2015 at 15:45:34 UTC, anonymous wrote:
Please show an example of .dup you'd like to avoid.
For example, if you need to create a five-dimensional array of
strings :)
On Saturday, 13 June 2015 at 16:20:46 UTC, anonymous wrote:
Do you like to write?
char[][] strArray = [foo.dup, bar.dup, baz.dup];
Ok. That's all you're on about? Basically you'd like this:
char[] s = foo;
and this:
char[][] a = [[foo]];
etc.
Yes. That's right, and not otherwise :)
On Saturday, 13 June 2015 at 17:02:06 UTC, Dennis Ritchie wrote:
On Saturday, 13 June 2015 at 16:20:46 UTC, anonymous wrote:
[...]
Yeah, that would be neat. But typing out .dup isn't that
bad, and converting a `string[]` to a `char[][]` is simple:
import std.conv: to;
auto a =
Type is probably possible, though conversion method will be
simpler. You can even try to write a specialization of `to` for
multidimentional arrays if it doesn't work.
Hello, everyone!
I like to work with arrays of strings like `string[] strArray`,
but unfortunately, they are immutable.
I do not like to work with arrays of strings such as `char[][]
strArray`, because it is necessary to apply the method .dup each
substring to make them work :)
I
On Saturday, 13 June 2015 at 15:45:34 UTC, anonymous wrote:
Before jumping to a solution, please elaborate on the perceived
problem. I have a feeling that there is none.
Do you like to write?
char[][] strArray = [foo.dup, bar.dup, baz.dup];
I suggest that such an option:
str[] strArray =
On Saturday, 13 June 2015 at 15:45:34 UTC, anonymous wrote:
Huh? You mean with string literals? That would be a rather
silly reason to avoid `char[]`. Please show an example of .dup
you'd like to avoid.
Yes, string literals.
I understand that the type of `string[]` to D is a simple data
On Saturday, 13 June 2015 at 15:58:44 UTC, Dennis Ritchie wrote:
On Saturday, 13 June 2015 at 15:45:34 UTC, anonymous wrote:
Before jumping to a solution, please elaborate on the
perceived problem. I have a feeling that there is none.
Do you like to write?
char[][] strArray = [foo.dup,
On Saturday, 13 June 2015 at 16:09:58 UTC, Dennis Ritchie wrote:
On Saturday, 13 June 2015 at 15:45:34 UTC, anonymous wrote:
[...]
Are you saying that `string[]` is simpler than `char[][]`?
That's not true: `string` is an alias for `immutable(char)[]`,
so `string[]` is the same as
On Saturday, 13 June 2015 at 15:21:19 UTC, Dennis Ritchie wrote:
I wish to propose the creation of new types of data D: str,
wstr, dstr, which will be the analogs of C++
`std::vectorstd::string`.
Ie str, wstr, dstr be mutable counterparts immutable strings
respectively str (mutable(char[])),
On Saturday, 13 June 2015 at 18:15:30 UTC, Dennis Ritchie wrote:
Actually, I will file issue `std.conv` in Phobos to add such
specifications. It will suit me.
*specializations
On Saturday, 13 June 2015 at 17:39:25 UTC, Kagamin wrote:
Type is probably possible, though conversion method will be
simpler. You can even try to write a specialization of `to` for
multidimentional arrays if it doesn't work.
It appears the problem can be solved by creating specifications
On Saturday, 13 June 2015 at 17:37:31 UTC, anonymous wrote:
Please show how it is not. Seems to work just fine.
OK. Still, this method works:
char[][][][][][] strArr = [foo, baz], [bar,
tor.to!(char[][][][][])];
But I don't want to write this `.to!(char[][][][][])`.
On Saturday,
14 matches
Mail list logo