Re: Annotation of functions

2018-02-22 Thread psychoticRabbit via Digitalmars-d
On Thursday, 22 February 2018 at 14:50:37 UTC, Seb wrote: On Wednesday, 21 February 2018 at 01:58:17 UTC, psychoticRabbit wrote: On Tuesday, 20 February 2018 at 15:26:12 UTC, Adam D. Ruppe wrote: dmd -X spits out the json file with a list of functions and classes and other stuff. Then you

Re: Annotation of functions

2018-02-22 Thread Seb via Digitalmars-d
On Wednesday, 21 February 2018 at 01:58:17 UTC, psychoticRabbit wrote: On Tuesday, 20 February 2018 at 15:26:12 UTC, Adam D. Ruppe wrote: dmd -X spits out the json file with a list of functions and classes and other stuff. Then you can just filter that. 'dmd -X' looks like the perfect

Re: Annotation of functions

2018-02-22 Thread psychoticRabbit via Digitalmars-d
On Thursday, 22 February 2018 at 13:17:42 UTC, ag0aep6g wrote: You don't have to remove the brackets. You just have to process the result correctly. It's not an object but an array with an object as its first element. ok. I think I demonstrated that I don't know what I'm doing with the

Re: Annotation of functions

2018-02-22 Thread ag0aep6g via Digitalmars-d
On 02/22/2018 12:54 PM, psychoticRabbit wrote: module test; import std.stdio, std.file, std.json; void main() {     string myFile= "source.json"; // a file produced by: dmd -o- -X source.d     string js = readText(myFile);     JSONValue j = parseJSON( js[1..$-1] ); // why do I have to

Re: Annotation of functions

2018-02-22 Thread psychoticRabbit via Digitalmars-d
On Thursday, 22 February 2018 at 11:32:59 UTC, rjframe wrote: On Thu, 22 Feb 2018 10:41:48 +, psychoticRabbit wrote: On Tuesday, 20 February 2018 at 15:26:12 UTC, Adam D. Ruppe wrote: dmd -X spits out the json file with a list of functions and classes and other stuff. Then you can just

Re: Annotation of functions

2018-02-22 Thread rjframe via Digitalmars-d
On Thu, 22 Feb 2018 10:41:48 +, psychoticRabbit wrote: > On Tuesday, 20 February 2018 at 15:26:12 UTC, Adam D. Ruppe wrote: >> dmd -X spits out the json file with a list of functions and classes and >> other stuff. Then you can just filter that. > > do you know why the first and last

Re: Annotation of functions

2018-02-22 Thread psychoticRabbit via Digitalmars-d
On Tuesday, 20 February 2018 at 15:26:12 UTC, Adam D. Ruppe wrote: dmd -X spits out the json file with a list of functions and classes and other stuff. Then you can just filter that. do you know why the first and last character of the output from "dmd -o- -X somefile.d" are [ and ] with all

Re: Annotation of functions

2018-02-21 Thread Tony via Digitalmars-d
On Tuesday, 20 February 2018 at 12:15:57 UTC, psychoticRabbit wrote: I've noticed that Go and Rust annotate functions. func (in go) fn (in rust) I was kind of wondering why they made that choice, given compilers in many languages do not. On Tuesday, 20 February 2018 at 12:15:57 UTC,

Re: Annotation of functions

2018-02-21 Thread Patrick Schluter via Digitalmars-d
On Wednesday, 21 February 2018 at 01:53:42 UTC, psychoticRabbit wrote: On Tuesday, 20 February 2018 at 13:40:16 UTC, bauss wrote: I should probably have put an example usage to show how it's used: This makes we want to go back and program in C again ;-) (but thanks for taking the

Re: Annotation of functions

2018-02-21 Thread Steven Schveighoffer via Digitalmars-d
On 2/20/18 8:53 PM, psychoticRabbit wrote: On Tuesday, 20 February 2018 at 13:40:16 UTC, bauss wrote: I should probably have put an example usage to show how it's used: This makes we want to go back and program in C again ;-) (but thanks for taking the time to demo/explain) Mixins

Re: Annotation of functions

2018-02-20 Thread psychoticRabbit via Digitalmars-d
On Tuesday, 20 February 2018 at 15:26:12 UTC, Adam D. Ruppe wrote: dmd -X spits out the json file with a list of functions and classes and other stuff. Then you can just filter that. 'dmd -X' looks like the perfect solution for my need. thanks.

Re: Annotation of functions

2018-02-20 Thread psychoticRabbit via Digitalmars-d
On Tuesday, 20 February 2018 at 13:40:16 UTC, bauss wrote: I should probably have put an example usage to show how it's used: This makes we want to go back and program in C again ;-) (but thanks for taking the time to demo/explain)

Re: Annotation of functions

2018-02-20 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 20 February 2018 at 13:27:08 UTC, psychoticRabbit wrote: so.. in that case..another idea...how about a compiler option to output a list of functions. (I don't really expect many will warm to that idea.) Does anyone know of any tool that could do such a thing? I just want of a

Re: Annotation of functions

2018-02-20 Thread Adam D. Ruppe via Digitalmars-d
On Tuesday, 20 February 2018 at 12:15:57 UTC, psychoticRabbit wrote: I've noticed that Go and Rust annotate functions. func (in go) fn (in rust) I was kind of wondering why they made that choice, given compilers in many languages do not. A lot of dynamic languages do too def foo(): #

Re: Annotation of functions

2018-02-20 Thread jmh530 via Digitalmars-d
On Tuesday, 20 February 2018 at 12:15:57 UTC, psychoticRabbit wrote: I've noticed that Go and Rust annotate functions. func (in go) fn (in rust) I was kind of wondering why they made that choice, given compilers in many languages do not. Would this be a useful feature in D? Everything else

Re: Annotation of functions

2018-02-20 Thread Jonathan M Davis via Digitalmars-d
On Tuesday, February 20, 2018 13:04:42 psychoticRabbit via Digitalmars-d wrote: > On Tuesday, 20 February 2018 at 12:55:31 UTC, psychoticRabbit > > wrote: > > fn string creater() pure { > > > > return "void func() {}"; > > > > } > > > > so now I'm just looking for lines that begin with fn.

Re: Annotation of functions

2018-02-20 Thread bauss via Digitalmars-d
On Tuesday, 20 February 2018 at 13:39:17 UTC, bauss wrote: On Tuesday, 20 February 2018 at 12:55:31 UTC, psychoticRabbit wrote: On Tuesday, 20 February 2018 at 12:45:25 UTC, rikki cattermole wrote: string creater() pure { return "void func() {}"; } mixin(creator()); That is why.

Re: Annotation of functions

2018-02-20 Thread bauss via Digitalmars-d
On Tuesday, 20 February 2018 at 12:55:31 UTC, psychoticRabbit wrote: On Tuesday, 20 February 2018 at 12:45:25 UTC, rikki cattermole wrote: string creater() pure { return "void func() {}"; } mixin(creator()); That is why. There are plenty of functions, classes and structs that simply

Re: Annotation of functions

2018-02-20 Thread ketmar via Digitalmars-d
psychoticRabbit wrote: On Tuesday, 20 February 2018 at 12:18:47 UTC, rikki cattermole wrote: So the point is moot. ok. I've come around... and the point reall is moot. so.. in that case..another idea...how about a compiler option to output a list of functions. (I don't really expect many

Re: Annotation of functions

2018-02-20 Thread psychoticRabbit via Digitalmars-d
On Tuesday, 20 February 2018 at 12:18:47 UTC, rikki cattermole wrote: So the point is moot. ok. I've come around... and the point reall is moot. so.. in that case..another idea...how about a compiler option to output a list of functions. (I don't really expect many will warm to that idea.)

Re: Annotation of functions

2018-02-20 Thread psychoticRabbit via Digitalmars-d
On Tuesday, 20 February 2018 at 12:55:31 UTC, psychoticRabbit wrote: fn string creater() pure { return "void func() {}"; } so now I'm just looking for lines that begin with fn. the mixin doesn't matter. oh... I think I might have misunderstood your point ... due to not understanding

Re: Annotation of functions

2018-02-20 Thread psychoticRabbit via Digitalmars-d
On Tuesday, 20 February 2018 at 12:45:25 UTC, rikki cattermole wrote: string creater() pure { return "void func() {}"; } mixin(creator()); That is why. There are plenty of functions, classes and structs that simply won't exist in the form of syntax until you execute CTFE. I think

Re: Annotation of functions

2018-02-20 Thread rikki cattermole via Digitalmars-d
On 20/02/2018 12:35 PM, psychoRabbit wrote: On Tuesday, 20 February 2018 at 12:18:47 UTC, rikki cattermole wrote: You need a fully implemented frontend to get anything proper in terms of parsing for D. We're not talking about syntax highlighting here. So the point is moot. Why is the point

Re: Annotation of functions

2018-02-20 Thread psychoRabbit via Digitalmars-d
On Tuesday, 20 February 2018 at 12:18:47 UTC, rikki cattermole wrote: You need a fully implemented frontend to get anything proper in terms of parsing for D. We're not talking about syntax highlighting here. So the point is moot. Why is the point (about being able to more easily find

Re: Annotation of functions

2018-02-20 Thread rikki cattermole via Digitalmars-d
On 20/02/2018 12:15 PM, psychoticRabbit wrote: I've noticed that Go and Rust annotate functions. func (in go) fn (in rust) I was kind of wondering why they made that choice, given compilers in many languages do not. Would this be a useful feature in D? Everything else seems to have an

Annotation of functions

2018-02-20 Thread psychoticRabbit via Digitalmars-d
I've noticed that Go and Rust annotate functions. func (in go) fn (in rust) I was kind of wondering why they made that choice, given compilers in many languages do not. Would this be a useful feature in D? Everything else seems to have an annotation (e.g structs, classes.) So why not