On Thursday, 16 February 2017 at 03:20:12 UTC, Jerry wrote:
I am trying to do opApply to work when the delegate passed when
it is and isn't nogc/nothrow. As soon as you involve a template
though, type inference goes out the door. I want to be able to
use opApply with templates (to get the auto
I am trying to do opApply to work when the delegate passed when
it is and isn't nogc/nothrow. As soon as you involve a template
though, type inference goes out the door. I want to be able to
use opApply with templates (to get the auto @nogc/nothrow
deducation passed on the delegate passed) but
On 02/15/2017 05:49 PM, Jean Cesar wrote:
> So I'm a beginner in this language and have very little time I started
> I'm interested in apprehending concepts of object orientation
> polymorphism inheritance, multiple inheritance as in c ++
D is similar to C++ but also very different.
> but I
On Wednesday, 15 February 2017 at 23:40:41 UTC, Ali Çehreli wrote:
On 02/15/2017 03:20 PM, Jean Cesar wrote:
How do I make a class person where I use set and get methods
to imput
the user type:
I have some information here:
http://ddili.org/ders/d.en/input.html
You should also know how
On Thursday, 16 February 2017 at 01:05:58 UTC, David Zhang wrote:
Is there a similar mechanism for one struct holding another?
You'd have to make the member a pointer to the struct.
immutable(B)* b;
On Thursday, 16 February 2017 at 00:49:45 UTC, Adam D. Ruppe
wrote:
On Thursday, 16 February 2017 at 00:43:30 UTC, David Zhang
wrote:
struct S {
O object;
}
import std.typecons;
Rebindable!O object;
http://dpldocs.info/experimental-docs/std.typecons.Rebindable.html
Is there a similar
On Thu, Feb 16, 2017 at 12:43:30AM +, David Zhang via Digitalmars-d-learn
wrote:
> Hi,
>
> Say I have a struct S that holds a reference to an object O. Is there
> a way to express that I want to be able to change the reference, but
> not what the reference points to? Thanks.
>
> struct S {
On Thursday, 16 February 2017 at 00:43:30 UTC, David Zhang wrote:
struct S {
O object;
}
import std.typecons;
Rebindable!O object;
http://dpldocs.info/experimental-docs/std.typecons.Rebindable.html
Hi,
Say I have a struct S that holds a reference to an object O. Is
there a way to express that I want to be able to change the
reference, but not what the reference points to? Thanks.
struct S {
O object;
}
class O {
size_t things.
}
On 02/15/2017 03:20 PM, Jean Cesar wrote:
How do I make a class person where I use set and get methods to imput
the user type:
I have some information here:
http://ddili.org/ders/d.en/input.html
You should also know how to read strings:
http://ddili.org/ders/d.en/strings.html
And this
On Wednesday, 15 February 2017 at 22:07:22 UTC, data pulverizer
wrote:
That's great, thanks both of you!
How do I make a class person where I use set and get methods to
imput the user type:
Import std.stdio;
class person
{
private:
string name, address;
int age;
float height;
public:
void setNome()
{
write("Enter Your Name:");
// the problem is here how am I going to read the
On Wed, Feb 15, 2017 at 10:58:42PM +, ag0aep6g via Digitalmars-d-learn
wrote:
> On Wednesday, 15 February 2017 at 22:34:22 UTC, H. S. Teoh wrote:
> > auto debugPrint(alias fun, A...)(A args) {
> > writefln("%s(%(%s, %))", __traits(identifier, fun), [args]);
> >
On Wednesday, 15 February 2017 at 22:34:22 UTC, H. S. Teoh wrote:
auto debugPrint(alias fun, A...)(A args) {
writefln("%s(%(%s, %))", __traits(identifier, fun), [args]);
return fun(args);
}
string arg = "hello";
string myCall =
On Wed, Feb 15, 2017 at 02:18:48PM -0800, H. S. Teoh via Digitalmars-d-learn
wrote:
[...]
> Try this:
>
> auto debugPrint(string expr)() {
> writeln(expr);
> return mixin(expr);
> }
>
> string myCall = debugPrint!`someFunction(1, "hello")`;
[...]
On Wed, Feb 15, 2017 at 10:07:22PM +, data pulverizer via
Digitalmars-d-learn wrote:
> I'd like to convert a call to a string for debug printing purposes for
> example:
>
>
> ```
> import std.stdio : writeln;
> void someFunction(int x, string y){}
> string myCall =
I'd like to convert a call to a string for debug printing
purposes for example:
```
import std.stdio : writeln;
void someFunction(int x, string y){}
string myCall = debugPrint(someFunction(1, "hello"));
writeln(myCall);
```
writes:
someFunction(1, "hello")
Does this functionality exists? If
On Wednesday, 15 February 2017 at 21:37:12 UTC, Jonathan M Davis
wrote:
On Wednesday, February 15, 2017 13:33:23 Jonathan M Davis via
Digitalmars-d- learn wrote:
On Wednesday, February 15, 2017 21:27:00 Andrew Chapman via
Digitalmars-d- learn wrote:
> Hi all, sorry if this question is silly,
On Wednesday, February 15, 2017 13:33:23 Jonathan M Davis via Digitalmars-d-
learn wrote:
> On Wednesday, February 15, 2017 21:27:00 Andrew Chapman via Digitalmars-d-
> learn wrote:
> > Hi all, sorry if this question is silly, but is it possible to
> > get the address of an object within the
On Wednesday, February 15, 2017 21:27:00 Andrew Chapman via Digitalmars-d-
learn wrote:
> Hi all, sorry if this question is silly, but is it possible to
> get the address of an object within the object itself?
>
> e.g.
>
> class Node
> {
> this()
> {
> writeln(); // Doesn't
Hi all, sorry if this question is silly, but is it possible to
get the address of an object within the object itself?
e.g.
class Node
{
this()
{
writeln(); // Doesn't work
}
}
auto node = new Node();
writeln(); // Does work
Thanks very much,
Cheers,
Andrew.
On Wednesday, 15 February 2017 at 15:58:41 UTC, Jonathan M Davis
wrote:
[...]
MonoTime before = MonoTime.currTime;
Thread.sleep(dur!"msecs"(1000));
MonoTime after = MonoTime.currTime;
Duration timeElapsed = after - before;
writeln(timeElapsed);
}
```
I get: "1 sec, 26
On Wednesday, 15 February 2017 at 16:11:36 UTC, drug wrote:
No, you recursively call main() and get segfault (due to stack
overflow) as expected
I thought, that an stack overflow leeds to an exception. But
that's not true, as I now see. Thanks for your answer.
On Wednesday, 15 February 2017 at 18:19:18 UTC, aberba wrote:
Trying to find it but working with a debugger in D is not
straight forward. Not yo talk of interpretating the debugger
output.
On linux it is pretty easy. Just compile with `-g` to dmd and run
the program in gdb. Run till it
I'm getting a segmentation fault in vibe.d web interface class.
Does referring "this" in an "if" or "switch" within a method
cause segfault?
Trying to find it but working with a debugger in D is not
straight forward. Not yo talk of interpretating the debugger
output.
How has things
15.02.2017 19:00, berni пишет:
I'm not sure if this is considered a bug:
import std.stdio;
import std.string;
int c = 0;
void main()
{
try {
write(++c," ");
stdout.flush();
int[10] tmp;
throw new Exception(format("%s",tmp));
} finally
{
I'm not sure if this is considered a bug:
import std.stdio;
import std.string;
int c = 0;
void main()
{
try {
write(++c," ");
stdout.flush();
int[10] tmp;
throw new Exception(format("%s",tmp));
} finally
{
main();
}
}
Output:
1 2 3 4 5 6
On Wednesday, February 15, 2017 16:27:34 drug via Digitalmars-d-learn wrote:
> 15.02.2017 16:19, berni пишет:
> > I need to measure time elapsed in seconds, like this:
> >> auto start = Clock.currStdTime();
> >> // some stuff
> >> auto stop = Clock.currStdTime();
> >> auto duration =
On Wednesday, 15 February 2017 at 13:19:57 UTC, berni wrote:
I need to measure time elapsed in seconds, like this:
auto start = Clock.currStdTime();
// some stuff
auto stop = Clock.currStdTime();
auto duration = (stop-start)/1000;
This works, but I wonder if there is something better
15.02.2017 16:19, berni пишет:
I need to measure time elapsed in seconds, like this:
auto start = Clock.currStdTime();
// some stuff
auto stop = Clock.currStdTime();
auto duration = (stop-start)/1000;
This works, but I wonder if there is something better that using the
magic constant
I need to measure time elapsed in seconds, like this:
auto start = Clock.currStdTime();
// some stuff
auto stop = Clock.currStdTime();
auto duration = (stop-start)/1000;
This works, but I wonder if there is something better that using
the magic constant 1000. I read about 10.secs
On Tuesday, 14 February 2017 at 15:57:47 UTC, Moritz Maxeiner
wrote:
You seem to be trying to argue against someone stating memory
barriers should be emitted automatically, though I don't know
why you think that's me; You initially stated that
Memory barriers are a bad idea because they don't
32 matches
Mail list logo