On Thursday, November 30, 2017 06:29:43 helxi via Digitalmars-d-learn wrote:
> 1. Why are imports visible from outside the package when you do
> selective imports?
>
> //mod.d
> module mod;
>
> import std.stdio : writeln;
>
> public void greet()
> {
> writeln("Hello");
> }
>
>
> //app.d
> impo
On 11/29/2017 08:31 PM, Tony wrote:
What does the moveFront() method do in the InputRange interface?
std.range.interfaces : InputRange.moveFront()
move is an operation that transfers the state of the source to the
destination. The front element becomes its .init value and its previous
values
1. Why are imports visible from outside the package when you do
selective imports?
//mod.d
module mod;
import std.stdio : writeln;
public void greet()
{
writeln("Hello");
}
//app.d
import mod;
void main()
{
mod.greet();
writeln("You should not be seeing this.");
}
Comp
What does the moveFront() method do in the InputRange interface?
std.range.interfaces : InputRange.moveFront()
On 11/29/17 10:22 PM, Jonathan M Davis wrote:
With classes, you could also assign the entire state of the object similar
to what you'd get with structs and opAssign, but you'd have to write a
member function to do it. There's no reason that you couldn't do the
equivalent of opAssign. It's just th
On Wednesday, November 29, 2017 17:26:11 Nick Treleaven via Digitalmars-d-
learn wrote:
> On Wednesday, 4 October 2017 at 20:49:26 UTC, John Gabriele wrote:
> > What's changed in the language, library, and community since
> > then that I should be aware of if following along with and
> > learning f
On Wednesday, November 29, 2017 21:12:58 Steven Schveighoffer via
Digitalmars-d-learn wrote:
> On 11/29/17 7:40 PM, David Colson wrote:
> > Hello all!
> >
> > I'm getting settled into D and I came into a problem. A code sample
> > shows it best:
> >
> > class SomeType
> > {
> >
> > string tex
On Thursday, 30 November 2017 at 00:40:51 UTC, David Colson wrote:
Hello all!
I'm getting settled into D and I came into a problem. A code
sample shows it best:
class SomeType
{
string text;
this(string input) {text = input;}
}
void main()
{
SomeType foo = new SomeType("Hello");
On 11/29/17 7:40 PM, David Colson wrote:
Hello all!
I'm getting settled into D and I came into a problem. A code sample
shows it best:
class SomeType
{
string text;
this(string input) {text = input;}
}
void main()
{
SomeType foo = new SomeType("Hello");
SomeType bar = f
On Friday, 24 November 2017 at 14:30:44 UTC, A Guy With a
Question wrote:
I would have expected 0 to be the default value. What's the
logic behind having them being NaN by default?
https://dlang.org/spec/type.html
http://www.drdobbs.com/cpp/nans-just-dont-get-no-respect/240005723
On Thursday, 30 November 2017 at 00:52:25 UTC, codephantom wrote:
...
sorry, don't know how the int * got in there ;-)
Anyway..who said you can't use pointers in D?
Just change:
//SomeType bar = foo;
SomeType * bar = &foo;
On Thursday, 30 November 2017 at 00:40:51 UTC, David Colson wrote:
Hello all!
I'm getting settled into D and I came into a problem. A code
sample shows it best:
class SomeType
{
string text;
this(string input) {text = input;}
}
void main()
{
SomeType foo = new SomeType("Hello");
On Thursday, 30 November 2017 at 00:40:51 UTC, David Colson wrote:
Hello all!
I'm getting settled into D and I came into a problem. A code
sample shows it best:
class SomeType
{
string text;
this(string input) {text = input;}
}
void main()
{
SomeType foo = new SomeType("Hello");
Hello all!
I'm getting settled into D and I came into a problem. A code
sample shows it best:
class SomeType
{
string text;
this(string input) {text = input;}
}
void main()
{
SomeType foo = new SomeType("Hello");
SomeType bar = foo;
foo = new SomeType("World");
wri
On Tuesday, 28 November 2017 at 13:39:11 UTC, Jayam wrote:
Can we compile our program to multi program ?
Based on your C# reference you must be referring to the "Mixed
Platform" build option. No, that is a .NET thing and D is not on
.NET (that project has died).
D requires a more traditiona
On Wednesday, 29 November 2017 at 17:26:11 UTC, Nick Treleaven
wrote:
On Wednesday, 4 October 2017 at 20:49:26 UTC, John Gabriele
wrote:
What's changed in the language, library, and community since
then that I should be aware of if following along with and
learning from that book?
Here's a li
On Wednesday, 29 November 2017 at 17:50:59 UTC, Arun
Chandrasekaran wrote:
Multiple alias this
You can only have one subtyping member currently.
Shared
Not all of shared's guarantees are implemented yet.
SafeD
@safe (and therefore SafeD) isn't fully implemented. So, it
doesn't necessarily
On Wednesday, 29 November 2017 at 17:26:11 UTC, Nick Treleaven
wrote:
Here's a list of significant things - maybe incomplete:
https://wiki.dlang.org/Differences_With_TDPL
Multiple alias this
You can only have one subtyping member currently.
Shared
Not all of shared's guarantees are implemen
On Wednesday, 4 October 2017 at 20:49:26 UTC, John Gabriele wrote:
What's changed in the language, library, and community since
then that I should be aware of if following along with and
learning from that book?
Here's a list of significant things - maybe incomplete:
https://wiki.dlang.org/Dif
On Wednesday, 29 November 2017 at 17:03:42 UTC, Steven
Schveighoffer wrote:
On 11/29/17 11:13 AM, Wanderer wrote:
I'm trying to simulate a race condition in D with the
following code:
(https://run.dlang.io/is/RfOX0I)
One word of caution, I think the running of your code on
run.dlang.io is c
On Wednesday, 29 November 2017 at 17:03:42 UTC, Steven
Schveighoffer wrote:
On 11/29/17 11:13 AM, Wanderer wrote:
I'm trying to simulate a race condition in D with the
following code:
(https://run.dlang.io/is/RfOX0I)
One word of caution, I think the running of your code on
run.dlang.io is c
On 11/29/17 11:13 AM, Wanderer wrote:
I'm trying to simulate a race condition in D with the following code:
(https://run.dlang.io/is/RfOX0I)
One word of caution, I think the running of your code on run.dlang.io is
cached. Refreshing doesn't make it re-run.
https://run.dlang.io/is/k0LhQA
-S
On 11/29/17 11:51 AM, Michael wrote:
On Wednesday, 29 November 2017 at 16:33:50 UTC, Steven Schveighoffer wrote:
On 11/29/17 11:13 AM, Wanderer wrote:
[...]
[snip]
[...]
Using the compiler switch -vcg-ast, I see no synchronization of these
methods.
[...]
Any idea what has changed in
On 11/29/17 11:46 AM, Wanderer wrote:
On Wednesday, 29 November 2017 at 16:33:50 UTC, Steven Schveighoffer wrote:
On 11/29/17 11:13 AM, Wanderer wrote:
[...]
[snip]
[...]
Using the compiler switch -vcg-ast, I see no synchronization of these
methods.
[...]
That's what I assume, I was
On Wednesday, 29 November 2017 at 16:33:50 UTC, Steven
Schveighoffer wrote:
On 11/29/17 11:13 AM, Wanderer wrote:
[...]
[snip]
[...]
Using the compiler switch -vcg-ast, I see no synchronization of
these methods.
[...]
Any idea what has changed in DMD-nightly to retain the correct
ord
On Wednesday, 29 November 2017 at 16:33:50 UTC, Steven
Schveighoffer wrote:
On 11/29/17 11:13 AM, Wanderer wrote:
[...]
[snip]
[...]
Using the compiler switch -vcg-ast, I see no synchronization of
these methods.
[...]
That's what I assume, I was just lucky not to see a race.
Thanks fo
On 11/29/17 11:13 AM, Wanderer wrote:
I'm trying to simulate a race condition in D with the following code:
[snip]
But all I get is correct IDs without any sign of a race (i.e. duplicate
ids).
Does compiler add synchronization for `shared` data?
Using the compiler switch -vcg-ast, I see no
On Wednesday, 29 November 2017 at 16:19:05 UTC, Michael wrote:
On Wednesday, 29 November 2017 at 16:13:13 UTC, Wanderer wrote:
[...]
I unfortunately cannot answer your question but I am noticing
that running the code with DMD gives you an unordered sequence
of IDs, but running with DMD-night
On Wednesday, 29 November 2017 at 16:19:05 UTC, Michael wrote:
On Wednesday, 29 November 2017 at 16:13:13 UTC, Wanderer wrote:
[...]
I unfortunately cannot answer your question but I am noticing
that running the code with DMD gives you an unordered sequence
of IDs, but running with DMD-night
On Wednesday, 29 November 2017 at 16:13:13 UTC, Wanderer wrote:
I'm trying to simulate a race condition in D with the following
code:
(https://run.dlang.io/is/RfOX0I)
```
import std.stdio;
import core.thread;
import std.concurrency;
shared struct IdGen(T)
{
T id;
this(T start)
{
I'm trying to simulate a race condition in D with the following
code:
(https://run.dlang.io/is/RfOX0I)
```
import std.stdio;
import core.thread;
import std.concurrency;
shared struct IdGen(T)
{
T id;
this(T start)
{
id = start;
}
T next()
{
id = id.nex
On Wednesday, 29 November 2017 at 11:32:51 UTC, Jayam wrote:
In D lang,
[...]
3. Can we make library file and use that in any project like
'Util class' ?
Of course ! Plenty of them can be found here:
https://code.dlang.org/?sort=updated&category=library
On Wednesday, 29 November 2017 at 11:32:51 UTC, Jayam wrote:
In D lang,
1. Is there any feature async/ await like "c#" ? I can't find
feature like async.
As for me, async/await feature is a half-baked solution. With
vibe-d you can write asynchronous code without thinking about it
at all. Detai
On 29/11/2017 11:32 AM, Jayam wrote:
In D lang,
1. Is there any feature async/ await like "c#" ? I can't find feature
like async.
No. The idea is floating around however.
2. Is Garbage Collector work default without any code to force like in
c# or do we need to manually trigger it ?
Automa
In D lang,
1. Is there any feature async/ await like "c#" ? I can't find
feature like async.
2. Is Garbage Collector work default without any code to force
like in c# or do we need to manually trigger it ?
3. Can we make library file and use that in any project like
'Util class' ?
On Wednesday, 29 November 2017 at 10:55:35 UTC, user1234 wrote:
On Wednesday, 29 November 2017 at 06:18:09 UTC, Fra Mecca wrote:
[...]
You must also use a type constructor later, when a
Configuration is declared:
```
immutable(Configuration) config;
config.toString.writeln; // okay this tim
On Wednesday, 29 November 2017 at 06:18:09 UTC, Fra Mecca wrote:
I have this struct:
immutable struct Configuration {
string title;
string baseurl;
string url;
string email;
string author;
string parser;
string target;
string urlFormat;
string urlFormatCmd;
37 matches
Mail list logo