Hi,
I'm going circles... ;) I read a string that contains an array of
unknown dimension like:
a = [1,2,3,4] or
a = [[1,2],[3,4]] or
a = [[[1,2],[3,4]],[[5,6],[7,8]]]
With that I want to perform specified operations e.g. also
provided on command line.
Because at compile time the dimension
On Wednesday, February 21, 2018 02:59:21 Nicholas Wilson via Digitalmars-d-
learn wrote:
> On Tuesday, 20 February 2018 at 15:32:45 UTC, Chris M. wrote:
> > Thanks for the info, that clears things up. Like I said, it was
> > more experimentation rather than me planning to actually use
> > it.
On Tuesday, 20 February 2018 at 15:32:45 UTC, Chris M. wrote:
Thanks for the info, that clears things up. Like I said, it was
more experimentation rather than me planning to actually use
it. Works now with the following modifications.
import std.stdio;
import core.stdc.stdlib;
import
On Tuesday, 20 February 2018 at 14:45:55 UTC, Dennis wrote:
I recently tried to go to that site, and I tried
`run.dlang.com` which is the wrong URL. So I was looking
through the D homepage for the right link but couldn't find it.
Even a Google search for "online d compiler" or "run dlang
On Tuesday, 20 February 2018 at 16:20:45 UTC, Smaehtin wrote:
On Tuesday, 20 February 2018 at 16:15:56 UTC, Radu wrote:
On Tuesday, 20 February 2018 at 16:01:11 UTC, Smaehtin wrote:
I'm trying to understand why the following doesn't work:
import std.stdio;
import std.variant;
void main()
{
On 2/20/18 2:00 PM, bachmeier wrote:
Someone has posted a question on our subreddit. Would be nice if he
could get an answer:
https://www.reddit.com/r/d_language/comments/7yxwvm/why_do_my_threads_write_to_the_wrong_file/
I responded. Looks to me like a race condition in the DMC libc code,
Someone has posted a question on our subreddit. Would be nice if
he could get an answer:
https://www.reddit.com/r/d_language/comments/7yxwvm/why_do_my_threads_write_to_the_wrong_file/
On Tuesday, 20 February 2018 at 16:12:17 UTC, Adam D. Ruppe wrote:
On Monday, 19 February 2018 at 08:28:22 UTC, aliak wrote:
T is the wrapped type. So if T has a member (in the example
it's the built in field "max") then forward that.
Oh, I see what you mean.
So the problem is that built in
On Tuesday, 20 February 2018 at 11:27:23 UTC, Alex wrote:
There is a related ticket,
https://issues.dlang.org/show_bug.cgi?id=6434
However, not exactly facing this question.
Should that ticket be marked as resolved? The issue is for alias
this to be considered before opDispatch but there were
On Tuesday, 20 February 2018 at 16:15:56 UTC, Radu wrote:
On Tuesday, 20 February 2018 at 16:01:11 UTC, Smaehtin wrote:
I'm trying to understand why the following doesn't work:
import std.stdio;
import std.variant;
void main()
{
Algebraic!(string, int) test = "Test";
test.tryVisit!(
On Tuesday, 20 February 2018 at 16:01:11 UTC, Smaehtin wrote:
I'm trying to understand why the following doesn't work:
import std.stdio;
import std.variant;
void main()
{
Algebraic!(string, int) test = "Test";
test.tryVisit!(
(ref string s) { s = "Why does this not work?"; }
On Monday, 19 February 2018 at 08:28:22 UTC, aliak wrote:
T is the wrapped type. So if T has a member (in the example
it's the built in field "max") then forward that.
Oh, I see what you mean.
So the problem is that built in types don't have "members" per
se, they have "magic". The built in
I'm trying to understand why the following doesn't work:
import std.stdio;
import std.variant;
void main()
{
Algebraic!(string, int) test = "Test";
test.tryVisit!(
(ref string s) { s = "Why does this not work?"; }
);
writeln(test);
}
But this works fine:
On Tuesday, 20 February 2018 at 15:18:11 UTC, Adam D. Ruppe wrote:
On Tuesday, 20 February 2018 at 14:56:54 UTC, Chris M. wrote:
I'm doing this mainly for experimentation, but the following
piece of code gives all sorts of errors.
so important note: this will perform worse than the automatic
On Tuesday, 20 February 2018 at 14:34:53 UTC, bauss wrote:
Would there be a reason why this wouldn't be a good
implementation?
What is the intended use case for this? The main feature seems to
be an ability to have read-only members, which is nice. Are there
other benefits?
If so what
On Tuesday, 20 February 2018 at 14:56:54 UTC, Chris M. wrote:
I'm doing this mainly for experimentation, but the following
piece of code gives all sorts of errors. Hangs, segfaults or
prints nothing and exits
import std.stdio;
import core.stdc.stdlib;
void main()
{
auto f = cast(File *)
On Tuesday, 20 February 2018 at 15:21:59 UTC, Uknown wrote:
On Tuesday, 20 February 2018 at 14:56:54 UTC, Chris M. wrote:
void main()
[snip]
Never mind, I confused FILE* with File...
On Tuesday, 20 February 2018 at 14:56:54 UTC, Chris M. wrote:
I'm doing this mainly for experimentation, but the following
piece of code gives all sorts of errors.
so important note: this will perform worse than the automatic
allocation, which just puts it down in-place. You should
basically
I'm doing this mainly for experimentation, but the following
piece of code gives all sorts of errors. Hangs, segfaults or
prints nothing and exits
import std.stdio;
import core.stdc.stdlib;
void main()
{
auto f = cast(File *) malloc(File.sizeof);
*f = File("test.txt", "r");
I recently tried to go to that site, and I tried `run.dlang.com`
which is the wrong URL. So I was looking through the D homepage
for the right link but couldn't find it. Even a Google search for
"online d compiler" or "run dlang online" didn't turn up anything
directly, I had to go through the
Would there be a reason why this wouldn't be a good
implementation?
If so what and how could it be improved?
Are there flaws in an implementation like this?
struct Property(T, bool readOnly = false)
{
import std.traits : isScalarType, isArray,
isAssociativeArray, isSomeString;
On Monday, 19 February 2018 at 15:02:29 UTC, ketmar wrote:
Clinton wrote:
On Monday, 19 February 2018 at 14:55:01 UTC, Clinton wrote:
[...]
Sorry, on second look my explanation isn't very clear. I want
to know if:
bool[string] myAA;
myAA[contact.id] = true; // Does this copy contact.id
It would be nice if there was a link to https://run.dlang.io/ on
the dlang website - preferably under Resources drop-down menu or
similar.
Or is there somewhere and I am just missing it?
I have bookmarked it for myself, but it would be better for
newbies if it was also easily accessible from
On Monday, 19 February 2018 at 08:28:22 UTC, aliak wrote:
On Monday, 19 February 2018 at 01:00:23 UTC, Adam D. Ruppe
wrote:
On Monday, 19 February 2018 at 00:42:05 UTC, aliak wrote:
struct B(T) {
T t;
A a;
alias a this;
auto opDispatch(string name)() if (hasMember!(T, name)) {
On Tuesday, February 20, 2018 08:44:37 aberba via Digitalmars-d-learn wrote:
> On Sunday, 18 February 2018 at 15:23:14 UTC, Cym13 wrote:
> > On Sunday, 18 February 2018 at 14:48:59 UTC, Cym13 wrote:
> >> [...]
> >
> > Just thought of a much better/simpler solution for that last
> > case that also
On Sunday, 18 February 2018 at 15:23:14 UTC, Cym13 wrote:
On Sunday, 18 February 2018 at 14:48:59 UTC, Cym13 wrote:
[...]
Just thought of a much better/simpler solution for that last
case that also doesn't force you to read all data (which might
be impossible when dealing with infinite
26 matches
Mail list logo