Re: Noob questions

2019-04-24 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 24 April 2019 at 22:44:17 UTC, 0x10001 wrote: Hello, i've hit some roadblocks while trying to learn D, i'll try to explain each of them below : [...] Regarding question 1, I had the same question some days ago https://forum.dlang.org/thread/akootxwiopsltifwd...@forum.dlang.org

Noob questions

2019-04-24 Thread 0x10001 via Digitalmars-d-learn
Hello, i've hit some roadblocks while trying to learn D, i'll try to explain each of them below : 1: Why does using readf in a function causes readln in following functions to "skip"(or do as if i had pressed enter?) Here's an example code(excuse me if it doesn't appear formatted) : import

Re: Static struct?

2019-04-24 Thread H. S. Teoh via Digitalmars-d-learn
On Wed, Apr 24, 2019 at 09:12:10PM +, JN via Digitalmars-d-learn wrote: > I noticed a construct I haven't seen before in D when reading the > description for automem - https://github.com/atilaneves/automem > > static struct Point { > int x; > int y; > } > > > What does

Re: Static struct?

2019-04-24 Thread user1234 via Digitalmars-d-learn
On Wednesday, 24 April 2019 at 21:12:10 UTC, JN wrote: I noticed a construct I haven't seen before in D when reading the description for automem - https://github.com/atilaneves/automem static struct Point { int x; int y; } What does "static" do in this case? How does it

Re: Static struct?

2019-04-24 Thread Rubn via Digitalmars-d-learn
On Wednesday, 24 April 2019 at 21:12:10 UTC, JN wrote: I noticed a construct I haven't seen before in D when reading the description for automem - https://github.com/atilaneves/automem static struct Point { int x; int y; } What does "static" do in this case? How does it

Static struct?

2019-04-24 Thread JN via Digitalmars-d-learn
I noticed a construct I haven't seen before in D when reading the description for automem - https://github.com/atilaneves/automem static struct Point { int x; int y; } What does "static" do in this case? How does it different to a normal struct?

Re: SpinButton Signal Oddness...

2019-04-24 Thread Ron Tarrant via Digitalmars-d-learn
On Wednesday, 24 April 2019 at 14:18:00 UTC, Ron Tarrant wrote: I posted this over on the gtkD forum, but thought I'd post here, too, to get a wider pool of expertise: This issue has been resolved over here: https://forum.gtkd.org/groups/GtkD/thread/982/

Re: Retrieving Column Data from a ListStore?

2019-04-24 Thread Ron Tarrant via Digitalmars-d-learn
On Wednesday, 24 April 2019 at 15:13:29 UTC, Mike Wey wrote: The ListStore/TreeModel provides functions to retrieve the data, `gtk.TreeModelIF.TreeModelIF.getValue`. A TreeIter indicates the row these kind of function apply to. Well, this is embarrassing. I tried that earlier and it didn't

Re: Call delegate from C++

2019-04-24 Thread Jacob Carlborg via Digitalmars-d-learn
On 2019-04-24 18:20, Nicholas Wilson wrote: How do you pass a delegate to a c++ function to be called by it? The function to pass the delegate to is: extern (C++) int fakeEntrypoint(     extern(C++) void function(void* /*delegate's context*/) func,     void* /*delegate's context*/ arg);

Re: incomplete mixin expression

2019-04-24 Thread Adam D. Ruppe via Digitalmars-d-learn
On Wednesday, 24 April 2019 at 17:22:42 UTC, Andrey wrote: alias Qwerty = Alias!(mixin("AliasSeq!(" ~ args ~ ");")); } the inner ; is inappropriate there fixing that might help

incomplete mixin expression

2019-04-24 Thread Andrey via Digitalmars-d-learn
enum Qaz : wstring { One = "один" } template Qwerty(Values...) { enum text = "Values[%d]"; enum args = iota(Values.length).map!(value => format!text(value)).join(','); pragma(msg, args); alias Qwerty = Alias!(mixin("AliasSeq!(" ~ args ~ ");")); } void main() {

Call delegate from C++

2019-04-24 Thread Nicholas Wilson via Digitalmars-d-learn
How do you pass a delegate to a c++ function to be called by it? The function to pass the delegate to is: extern (C++) int fakeEntrypoint( extern(C++) void function(void* /*delegate's context*/) func, void* /*delegate's context*/ arg); What I want is: int entrypoint(scope void

Re: Retrieving Column Data from a ListStore?

2019-04-24 Thread Mike Wey via Digitalmars-d-learn
On 24-04-2019 16:38, Ron Tarrant wrote: Another thing I've been struggling with is fetching data from a TreeIter. Getting the iter itself is no problem, but when it comes to getting the contents of a specific column within the iter, none of the methods I've tried have worked. In fact, it

Retrieving Column Data from a ListStore?

2019-04-24 Thread Ron Tarrant via Digitalmars-d-learn
Another thing I've been struggling with is fetching data from a TreeIter. Getting the iter itself is no problem, but when it comes to getting the contents of a specific column within the iter, none of the methods I've tried have worked. In fact, it almost seems like none of them are

SpinButton Signal Oddness...

2019-04-24 Thread Ron Tarrant via Digitalmars-d-learn
I posted this over on the gtkD forum, but thought I'd post here, too, to get a wider pool of expertise: I hooked up some signals to a few SpinButtons and I'm getting double-firings, but not all the time. The buttons are as follows: - double, - float with no extra precision, and - float with

Re: gtkDcoding Blog Post # 29 - RadioMenuItems

2019-04-24 Thread Ron Tarrant via Digitalmars-d-learn
On Wednesday, 24 April 2019 at 11:41:12 UTC, number wrote: Are your original php gtk tutorials still available somewhere? I found this (https://php.gtk.general.narkive.com/G1Fuuk38/php-gtk-treeview-toggle) but http://www.writingup.com/ does not respond. I still have the entire set of blog

Re: Chat using Socket and Thread

2019-04-24 Thread Cym13 via Digitalmars-d-learn
On Tuesday, 23 April 2019 at 22:02:59 UTC, Allison wrote: How to make a chat for several users chat? Using socket and thread. First of all, there are many tutorials on the internet covering that exact topic for different languages. I don't think there are many tutorials for D, but you should

Re: gtkDcoding Blog Post # 29 - RadioMenuItems

2019-04-24 Thread number via Digitalmars-d-learn
On Tuesday, 23 April 2019 at 20:40:45 UTC, Ron Tarrant wrote: On Tuesday, 23 April 2019 at 12:21:37 UTC, number wrote: Hi, thanks! little typo: RadioMeniItem How about that? The typo was in the article, not the code. Makes for a change. :) Thanks for catching, number. Are your original

Re: Check if function argument can be handled in CT

2019-04-24 Thread Mike Parker via Digitalmars-d-learn
On Wednesday, 24 April 2019 at 10:52:58 UTC, Andrey wrote: On Wednesday, 24 April 2019 at 08:28:06 UTC, Basile.B wrote: On Wednesday, 24 April 2019 at 07:53:47 UTC, Andrey wrote: I know about this template. Unfortunally, it doesn't work inside functions. void test(string arg1, string arg2)

Re: Check if function argument can be handled in CT

2019-04-24 Thread Andrey via Digitalmars-d-learn
On Wednesday, 24 April 2019 at 08:28:06 UTC, Basile.B wrote: On Wednesday, 24 April 2019 at 07:53:47 UTC, Andrey wrote: I know about this template. Unfortunally, it doesn't work inside functions. void test(string arg1, string arg2) { enum isKnown1 = is(typeof((){enum v = arg1;}));

Re: Check if function argument can be handled in CT

2019-04-24 Thread Basile.B via Digitalmars-d-learn
On Wednesday, 24 April 2019 at 07:53:47 UTC, Andrey wrote: Hi all, Do you know can we detect that some argument of a function can be handled in CT? For example: int value1 = 10; someFunction(value1); int value2 = getValueFromUserInput(); someFunction(value2); void someFunction(int arg) {

Check if function argument can be handled in CT

2019-04-24 Thread Andrey via Digitalmars-d-learn
Hi all, Do you know can we detect that some argument of a function can be handled in CT? For example: int value1 = 10; someFunction(value1); int value2 = getValueFromUserInput(); someFunction(value2); void someFunction(int arg) { static if(argCanBeHandledInCT(arg)) { // perform

Re: Future of D language

2019-04-24 Thread Cym13 via Digitalmars-d-learn
On Wednesday, 24 April 2019 at 05:22:35 UTC, Arjunkumar wrote: I am title bit confuse about learning D Lang and is it well good for future point of view. Currently in a market many of language is present, so why people learn D Lang and any site which provide best tutorials for D Lang? The

Re: Future of D language

2019-04-24 Thread Andre Pany via Digitalmars-d-learn
On Wednesday, 24 April 2019 at 05:22:35 UTC, Arjunkumar wrote: I am title bit confuse about learning D Lang and is it well good for future point of view. Currently in a market many of language is present, so why people learn D Lang and any site which provide best tutorials for D Lang? For