Re: Scala considering significant indentation like Python

2017-05-25 Thread Rustom Mody
On Wednesday, May 24, 2017 at 8:01:53 PM UTC+5:30, Rustom Mody wrote: > On Wednesday, May 24, 2017 at 2:14:15 AM UTC+5:30, Ben Finney wrote: > > Grant Edwards grant.b.edwards writes: > > > > > On 2017-05-23, Michael Torrie wrote: > > > > Sometimes things get longer than a page (like a class defin

Re: Scala considering significant indentation like Python

2017-05-24 Thread Rustom Mody
On Wednesday, May 24, 2017 at 2:14:15 AM UTC+5:30, Ben Finney wrote: > Grant Edwards grant.b.edwards writes: > > > On 2017-05-23, Michael Torrie wrote: > > > Sometimes things get longer than a page (like a class definition). > > > > A nice folding mode works nicely for that sort of thing. I norma

Re: Scala considering significant indentation like Python

2017-05-24 Thread Grant Edwards
On 2017-05-23, Ben Finney wrote: > Grant Edwards writes: > >> On 2017-05-23, Michael Torrie wrote: >> > Sometimes things get longer than a page (like a class definition). >> >> A nice folding mode works nicely for that sort of thing. I normally >> use emacs, but it doesn't seem to have a folding

Emacs command to select only lines indented below a specified level (was: Scala considering significant indentation like Python)

2017-05-23 Thread Ben Finney
Fred Stluka writes: > On 5/23/17 4:43 PM, Ben Finney wrote: > > > The ‘set-selective-display’ command […] is bound to ‘C-x $’ in > > default Emacs. > > How do I specify the number of columns when using "C-x $"? You will remember, from doing the Emacs tutorial when you first learned Emacs, that a

Re: Scala considering significant indentation like Python

2017-05-23 Thread Fred Stluka
On 5/23/17 4:43 PM, Ben Finney wrote: The ‘set-selective-display’ command will collapse the current buffer's text to lines indented to the specified number of columns; the same command with no argument will expand the buffer to normal again. The command is bound to ‘C-x $’ in default Emacs. Ben

Re: Scala considering significant indentation like Python

2017-05-23 Thread Ben Finney
Grant Edwards writes: > On 2017-05-23, Michael Torrie wrote: > > Sometimes things get longer than a page (like a class definition). > > A nice folding mode works nicely for that sort of thing. I normally > use emacs, but it doesn't seem to have a folding mode built-in, and > the add-on one's I'v

Re: Scala considering significant indentation like Python

2017-05-23 Thread justin walters
On Tue, May 23, 2017 at 7:10 AM, Grant Edwards wrote: > On 2017-05-23, Michael Torrie wrote: > > On 05/22/2017 02:57 PM, Ethan Furman wrote: > >>> Kind of reminds me of LISP. Lots of closing parenths, and often then > >>> just all get stuck together on a long. But I guess that's why they > >>>

Re: Scala considering significant indentation like Python

2017-05-23 Thread Grant Edwards
On 2017-05-23, Michael Torrie wrote: > On 05/22/2017 02:57 PM, Ethan Furman wrote: >>> Kind of reminds me of LISP. Lots of closing parenths, and often then >>> just all get stuck together on a long. But I guess that's why they >>> invented paren matching shortcuts in editors. To make it easy to

Re: Scala considering significant indentation like Python

2017-05-22 Thread Mikhail V
> The creator of Scala, Martin Odersky, has proposed introducing Python-like > significant indentation to Scala and getting rid of braces: > > I was playing for a while now with ways to make Scala's syntax >indentation-based. I always admired the neatness of Python syntax >and also found

Re: Scala considering significant indentation like Python

2017-05-22 Thread Michael Torrie
On 05/22/2017 02:57 PM, Ethan Furman wrote: >> Kind of reminds me of LISP. Lots of closing parenths, and often then >> just all get stuck together on a long. But I guess that's why they >> invented paren matching shortcuts in editors. To make it easy to see if >> you have them matched up. This

Re: Scala considering significant indentation like Python

2017-05-22 Thread Ethan Furman
On 05/22/2017 12:13 PM, Michael Torrie wrote: On 05/22/2017 07:59 AM, Jussi Piitulainen wrote: I am the inventor of multiple ends on the same line. This way, in a language where all of several nested constructs end with an end - not going to name the language but it's Julia - instead of

Re: Scala considering significant indentation like Python

2017-05-22 Thread Michael Torrie
On 05/22/2017 07:59 AM, Jussi Piitulainen wrote: > I am the inventor of multiple ends on the same line. This way, in a > language where all of several nested constructs end with an end - not > going to name the language but it's Julia - instead of > > end > end >

Re: Scala considering significant indentation like Python

2017-05-22 Thread oliver
Any nesting beyond third level should be strong candidate for refactoring. Soon after you do that, big surprise, refactored block gets better documented, gets used elsewhere, becomes testable on its own, etc. I.e. if structure is not obvious from indentation alone, refactoring is the proper solutio

Re: Scala considering significant indentation like Python

2017-05-22 Thread breamoreboy
On Monday, May 22, 2017 at 3:34:07 PM UTC+1, Serhiy Storchaka wrote: > 22.05.17 17:24, Skip Montanaro пише: > > On Mon, May 22, 2017 at 9:14 AM, bartc wrote: > >> I think 'end' can be used in Python too: > >> > >> if (cond): > >> stmts > >> end > >> > >> But: > >> > >> - You need to defi

Re: Scala considering significant indentation like Python

2017-05-22 Thread Serhiy Storchaka
22.05.17 17:24, Skip Montanaro пише: On Mon, May 22, 2017 at 9:14 AM, bartc wrote: I think 'end' can be used in Python too: if (cond): stmts end But: - You need to define a dummy variable 'end' Interesting idea. You can avoid the dummy variable part by just using '#end', however:

Re: Scala considering significant indentation like Python

2017-05-22 Thread Skip Montanaro
On Mon, May 22, 2017 at 9:14 AM, bartc wrote: > I think 'end' can be used in Python too: > > if (cond): > stmts > end > > But: > > - You need to define a dummy variable 'end' Interesting idea. You can avoid the dummy variable part by just using '#end', however: if cond: stmts #end Sk

Re: Scala considering significant indentation like Python

2017-05-22 Thread bartc
On 22/05/2017 14:59, Jussi Piitulainen wrote: Cholo Lennon writes: I am a huge python fan (but also a C++ and Java fan) and I agree with Scala creator, sometimes the readability is complicated. So, more often than I would like to, I end up missing the braces :-O I am the inventor of multipl

Re: Scala considering significant indentation like Python

2017-05-22 Thread Jussi Piitulainen
Cholo Lennon writes: > On 22/05/17 00:53, Steve D'Aprano wrote: >> The creator of Scala, Martin Odersky, has proposed introducing >> Python-like significant indentation to Scala and getting rid of >> braces: >> >> I was playing for a while now with ways to make Scala's syntax >> indentat

Re: Scala considering significant indentation like Python

2017-05-22 Thread Cholo Lennon
On 22/05/17 00:53, Steve D'Aprano wrote: The creator of Scala, Martin Odersky, has proposed introducing Python-like significant indentation to Scala and getting rid of braces: I was playing for a while now with ways to make Scala's syntax indentation-based. I always admired the neatnes

Scala considering significant indentation like Python

2017-05-21 Thread Steve D'Aprano
The creator of Scala, Martin Odersky, has proposed introducing Python-like significant indentation to Scala and getting rid of braces: I was playing for a while now with ways to make Scala's syntax indentation-based. I always admired the neatness of Python syntax and also found that F#