Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-21 Thread Danni Coy via Digitalmars-d
regular expression search FunctionName.*\{ or FunctionName.*$\s*\{ depending on brace style On Wed, Jan 21, 2015 at 4:37 AM, Joakim via Digitalmars-d wrote: > On Tuesday, 20 January 2015 at 00:13:37 UTC, Brian Schott wrote: >> >> On Monday, 19 January 2015 at 22:49:41 UTC, Ary Borenszweig wrote:

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-20 Thread Walter Bright via Digitalmars-d
On 1/20/2015 12:30 PM, Jonathan Marler wrote: Which editor do you use? https://github.com/DigitalMars/me

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-20 Thread ketmar via Digitalmars-d
On Tue, 20 Jan 2015 20:30:00 + Jonathan Marler via Digitalmars-d wrote: > On Tuesday, 20 January 2015 at 03:28:29 UTC, Walter Bright wrote: > > On 1/19/2015 7:20 PM, Walter Bright wrote: > >> Yes. "Search Again" is a single button press. It really has > >> never occurred to me > >> that this

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-20 Thread Jonathan Marler via Digitalmars-d
On Tuesday, 20 January 2015 at 03:28:29 UTC, Walter Bright wrote: On 1/19/2015 7:20 PM, Walter Bright wrote: Yes. "Search Again" is a single button press. It really has never occurred to me that this might be a problem needing a solution. I admit that I've never gotten in to using an IDE. I s

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-20 Thread Danni Coy via Digitalmars-d
> So... how do you search for a function definition in D without an IDE? Regular Expression Search for FunctionName.*\n\s*\{ or FunctionName.*\{ depending on brace style being used.

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-20 Thread Joakim via Digitalmars-d
On Tuesday, 20 January 2015 at 00:13:37 UTC, Brian Schott wrote: On Monday, 19 January 2015 at 22:49:41 UTC, Ary Borenszweig wrote: So... how do you search for a function definition in D without an IDE? Running `dscanner --help` prints this: --declaration | -d symbolName [sourceFiles sourceDi

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-20 Thread ketmar via Digitalmars-d
On Tue, 20 Jan 2015 13:49:47 + MattCoder via Digitalmars-d wrote: > On Tuesday, 20 January 2015 at 13:47:11 UTC, ketmar via > Digitalmars-d wrote: > > void function foo () { ... } > > foo(); > > > > do you see the subtle difference? yes, that tiny whitespace in > > declaration. i borrowe

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-20 Thread MattCoder via Digitalmars-d
On Tuesday, 20 January 2015 at 13:47:11 UTC, ketmar via Digitalmars-d wrote: void function foo () { ... } foo(); do you see the subtle difference? yes, that tiny whitespace in declaration. i borrowed that habit from some Oberon code decades ago, and it serves me well since then. Hmm, nice

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-20 Thread ketmar via Digitalmars-d
On Mon, 19 Jan 2015 22:35:16 -0300 Ary Borenszweig via Digitalmars-d wrote: > On 1/19/15 9:17 PM, Walter Bright wrote: > > On 1/19/2015 2:49 PM, Ary Borenszweig wrote: > >> So... how do you search for a function definition in D without an IDE? > > > > I do a text search for the name of the functi

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-20 Thread Steven Schveighoffer via Digitalmars-d
On 1/19/15 8:35 PM, Ary Borenszweig wrote: On 1/19/15 9:17 PM, Walter Bright wrote: On 1/19/2015 2:49 PM, Ary Borenszweig wrote: So... how do you search for a function definition in D without an IDE? I do a text search for the name of the function. I've been programming in C, C++, and D for

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-20 Thread Kagamin via Digitalmars-d
On Monday, 19 January 2015 at 20:51:03 UTC, Alexey T. wrote: Will be much easier to read Source, if func declarataion begins with keyword. "def" of "func". e.g. func myName(params.): typeOfResult; or func myName(params...) -> typeOfResult; easier to read and PARSE. Next D version may allow

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Jonathan M Davis via Digitalmars-d
On Monday, January 19, 2015 16:18:25 Walter Bright via Digitalmars-d wrote: > On 1/19/2015 2:51 PM, ponce wrote: > > Current syntax is akin to C and C++, it means many people already read it > > visually and it is easier to port C code to D. > > Bingo. It's designed to be an easy transition for peo

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread deadalnix via Digitalmars-d
On Tuesday, 20 January 2015 at 03:12:52 UTC, Andrei Alexandrescu wrote: "Tel maƮtre, tel valet." -- Andrei Will ruby now park cars ?

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Walter Bright via Digitalmars-d
On 1/19/2015 7:20 PM, Walter Bright wrote: Yes. "Search Again" is a single button press. It really has never occurred to me that this might be a problem needing a solution. I admit that I've never gotten in to using an IDE. I still have complaints about the programmer's editor I use, but they

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Walter Bright via Digitalmars-d
On 1/19/2015 5:35 PM, Ary Borenszweig wrote: On 1/19/15 9:17 PM, Walter Bright wrote: On 1/19/2015 2:49 PM, Ary Borenszweig wrote: So... how do you search for a function definition in D without an IDE? I do a text search for the name of the function. I've been programming in C, C++, and D fo

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Andrei Alexandrescu via Digitalmars-d
On 1/19/15 3:43 PM, Ary Borenszweig wrote: On 1/19/15 7:54 PM, Andrei Alexandrescu wrote: On 1/19/15 2:49 PM, Ary Borenszweig wrote: On 1/19/15 6:25 PM, Andrei Alexandrescu wrote: On 1/19/15 12:51 PM, Alexey T. wrote: Will be much easier to read Source, if func declarataion begins with keywor

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Rikki Cattermole via Digitalmars-d
On 20/01/2015 1:17 p.m., Walter Bright wrote: On 1/19/2015 2:49 PM, Ary Borenszweig wrote: So... how do you search for a function definition in D without an IDE? I do a text search for the name of the function. I've been programming in C, C++, and D for 30 years without an IDE. It never occur

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Vlad Levenfeld via Digitalmars-d
On Tuesday, 20 January 2015 at 01:35:17 UTC, Ary Borenszweig wrote: On 1/19/15 9:17 PM, Walter Bright wrote: On 1/19/2015 2:49 PM, Ary Borenszweig wrote: So... how do you search for a function definition in D without an IDE? I do a text search for the name of the function. I've been programm

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Jon via Digitalmars-d
On Tuesday, 20 January 2015 at 01:35:17 UTC, Ary Borenszweig wrote: On 1/19/15 9:17 PM, Walter Bright wrote: On 1/19/2015 2:49 PM, Ary Borenszweig wrote: So... how do you search for a function definition in D without an IDE? I do a text search for the name of the function. I've been programm

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Ary Borenszweig via Digitalmars-d
On 1/19/15 9:17 PM, Walter Bright wrote: On 1/19/2015 2:49 PM, Ary Borenszweig wrote: So... how do you search for a function definition in D without an IDE? I do a text search for the name of the function. I've been programming in C, C++, and D for 30 years without an IDE. It never occurred t

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Mike Parker via Digitalmars-d
On 1/20/2015 7:49 AM, Ary Borenszweig wrote: It works, but if you stop following that convention you are lost. So... how do you search for a function definition in D without an IDE? Case-insensitive search on "funcname(" usually works for me.

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread H. S. Teoh via Digitalmars-d
On Mon, Jan 19, 2015 at 04:17:08PM -0800, Walter Bright via Digitalmars-d wrote: > On 1/19/2015 2:49 PM, Ary Borenszweig wrote: > >So... how do you search for a function definition in D without an > >IDE? > > I do a text search for the name of the function. > > I've been programming in C, C++, an

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Walter Bright via Digitalmars-d
On 1/19/2015 2:51 PM, ponce wrote: Current syntax is akin to C and C++, it means many people already read it visually and it is easier to port C code to D. Bingo. It's designed to be an easy transition for people used to programming in C, C++ and Java.

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread weaselcat via Digitalmars-d
On Tuesday, 20 January 2015 at 00:13:37 UTC, Brian Schott wrote: On Monday, 19 January 2015 at 22:49:41 UTC, Ary Borenszweig wrote: So... how do you search for a function definition in D without an IDE? Running `dscanner --help` prints this: --declaration | -d symbolName [sourceFiles sourceDi

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Walter Bright via Digitalmars-d
On 1/19/2015 2:49 PM, Ary Borenszweig wrote: So... how do you search for a function definition in D without an IDE? I do a text search for the name of the function. I've been programming in C, C++, and D for 30 years without an IDE. It never occurred to me that this was not doable :-)

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Israel via Digitalmars-d
On Monday, 19 January 2015 at 21:25:16 UTC, Andrei Alexandrescu wrote: On 1/19/15 12:51 PM, Alexey T. wrote: Will be much easier to read Source, if func declarataion begins with keyword. "def" of "func". e.g. func myName(params.): typeOfResult; or func myName(params...) -> typeOfResult; e

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Brian Schott via Digitalmars-d
On Monday, 19 January 2015 at 22:49:41 UTC, Ary Borenszweig wrote: So... how do you search for a function definition in D without an IDE? Running `dscanner --help` prints this: --declaration | -d symbolName [sourceFiles sourceDirectories] Find the location where symbolName is declared. Thi

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread weaselcat via Digitalmars-d
On Monday, 19 January 2015 at 22:49:41 UTC, Ary Borenszweig wrote: On 1/19/15 6:25 PM, Andrei Alexandrescu wrote: On 1/19/15 12:51 PM, Alexey T. wrote: Will be much easier to read Source, if func declarataion begins with keyword. "def" of "func". e.g. func myName(params.): typeOfResult; o

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread deadalnix via Digitalmars-d
On Monday, 19 January 2015 at 21:06:40 UTC, Alexey T. wrote: Better that next D version (next MAJOR version) can support such syntax. (Old syntax may be compatible too but "deprecated"). What developers think.. That why not is a not a good enough reason to do it.

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Ary Borenszweig via Digitalmars-d
On 1/19/15 7:54 PM, Andrei Alexandrescu wrote: On 1/19/15 2:49 PM, Ary Borenszweig wrote: On 1/19/15 6:25 PM, Andrei Alexandrescu wrote: On 1/19/15 12:51 PM, Alexey T. wrote: Will be much easier to read Source, if func declarataion begins with keyword. "def" of "func". e.g. func myName(params

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Dicebot via Digitalmars-d
On Monday, 19 January 2015 at 22:54:04 UTC, Andrei Alexandrescu wrote: I abandon D and switch to Ruby. -- Andrei You should make a front page announcement.

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Andrei Alexandrescu via Digitalmars-d
On 1/19/15 2:49 PM, Ary Borenszweig wrote: On 1/19/15 6:25 PM, Andrei Alexandrescu wrote: On 1/19/15 12:51 PM, Alexey T. wrote: Will be much easier to read Source, if func declarataion begins with keyword. "def" of "func". e.g. func myName(params.): typeOfResult; or func myName(params...)

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread ponce via Digitalmars-d
On Monday, 19 January 2015 at 22:18:34 UTC, Alexey T. wrote: Ok I see your arguments, indeed, breaking masss of code isn't good (even with deprecated flag). So leave it as is (it is TOO LATE to change this) Current syntax is akin to C and C++, it means many people already read it visually and

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Ary Borenszweig via Digitalmars-d
On 1/19/15 6:25 PM, Andrei Alexandrescu wrote: On 1/19/15 12:51 PM, Alexey T. wrote: Will be much easier to read Source, if func declarataion begins with keyword. "def" of "func". e.g. func myName(params.): typeOfResult; or func myName(params...) -> typeOfResult; easier to read and PARSE.

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Walter Bright via Digitalmars-d
On 1/19/2015 1:23 PM, Jonathan Marler wrote: I'm not familiar enough with the syntax grammar to say for sure whether or not this would make it easier to parse the language. This idea is not going to make the parsing any better.

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Alexey T. via Digitalmars-d
Ok I see your arguments, indeed, breaking masss of code isn't good (even with deprecated flag). So leave it as is (it is TOO LATE to change this)

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Jonathan M Davis via Digitalmars-d
On Monday, January 19, 2015 20:51:02 Alexey T. via Digitalmars-d wrote: > Will be much easier to read Source, if func declarataion begins > with keyword. "def" of "func". e.g. > > func myName(params.): typeOfResult; > or > func myName(params...) -> typeOfResult; > > easier to read and PARSE. Ne

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread bachmeier via Digitalmars-d
On Monday, 19 January 2015 at 20:51:03 UTC, Alexey T. wrote: Will be much easier to read Source, if func declarataion begins with keyword. "def" of "func". e.g. func myName(params.): typeOfResult; or func myName(params...) -> typeOfResult; easier to read and PARSE. Next D version may allow

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Andrei Alexandrescu via Digitalmars-d
On 1/19/15 12:51 PM, Alexey T. wrote: Will be much easier to read Source, if func declarataion begins with keyword. "def" of "func". e.g. func myName(params.): typeOfResult; or func myName(params...) -> typeOfResult; easier to read and PARSE. Next D version may allow--with compatability of

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Jonathan Marler via Digitalmars-d
On Monday, 19 January 2015 at 21:06:40 UTC, Alexey T. wrote: Better that next D version (next MAJOR version) can support such syntax. (Old syntax may be compatible too but "deprecated"). What developers think.. I have a feeling you might get some strong opposition to this idea *Brace Yourself

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread Alexey T. via Digitalmars-d
Better that next D version (next MAJOR version) can support such syntax. (Old syntax may be compatible too but "deprecated"). What developers think..

Re: Like Go/Rust, why not to have "func" keyword before function declaration

2015-01-19 Thread ketmar via Digitalmars-d
On Mon, 19 Jan 2015 20:51:02 + "Alexey T. via Digitalmars-d" wrote: > Will be much easier to read Source, if func declarataion begins > with keyword. "def" of "func". e.g. > > func myName(params.): typeOfResult; > or > func myName(params...) -> typeOfResult; > > easier to read and PARS