Scala considering significant indentation like Python

Cholo Lennon chololennon at hotmail.com
Mon May 22 09:28:33 EDT 2017


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 neatness of Python syntax
>      and also found that F# has benefited greatly from its optional
>      indentation-based syntax, so much so that nobody seems to use
>      the original syntax anymore.
> 
> https://github.com/lampepfl/dotty/issues/2491
> 
> 
> 

 From the link:

"Impediments

What are the reasons for preferring braces over indentations?

Provide visual clues where constructs end. With pure indentation based 
syntax it is sometimes hard to tell how many levels of indentation are 
terminated at some point... "

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


-- 
Cholo Lennon
Bs.As.
ARG



More information about the Python-list mailing list