Python-like tabs instead of curley brackets?

Witold Baryluk baryluk at mpi.int.pl
Fri Dec 1 11:17:47 PST 2006


Dnia Fri, 01 Dec 2006 13:33:05 +0800
Daniel Keep <daniel.keep+lists at gmail.com> napisał/a:

> Question: how do you propose to do these with only indentation:
> 
>  > extern(C):
>  > << Butt-loads of non-indented code because indenting a whole file
>  > four spaces is stupid >>
> 

You can't do this in simple/automatic way. "Indented D" (if i can name
it so) is for other purpose - for quick & dirty scripting, accessing
library function, not creating them. Of course, we can create
rules, so all of D constructs will be possible/allowed, but probably
there will be lots of such rules. In hard cases I like strong syntax
discipline, and if there is any notstrict construct it is an error.

> Or this:
> 
>  > FunkyThing(some_expression,
>  > {
>  > 	<< More Code >>
>  > });
You can, or we can adapt backslash (like in bash) to do this:
FunkyThing(some_expression, \
{ \
	<< More Code >> \
}); \

I know, it is awful. Another proposition can be:
Implicit { introduce additional indentation level inside.
So it will be like:
FunkyThinkg(some, \
{
   xx
   if y:
     z
})


> Please stop being syntaxist -- all syntaxes are created equal!
:)

BTW. Whitespace also?

> P.S.  Just so you know, I love Python's syntax.  I just don't think
> it's suitable for D. :)
I also like Python's syntax, but i think small portion of D can be
adapted to this syntax (if anyone like tabs, and if it will be used
by anyone). I also think that people frustrated by Python syntax,
simply have bad editor/configuration. Lots of editors now is not tabaware.

PS. I use in all languages (Python, C, D, etc.) hard-tabs (for
indentations), which are displayed as 4-character in my
editor. There are simple rules to be consistent with such style, and not
introduce problems in any situation.


-- 
Witold Baryluk
MAIL: baryluk at smp.if.uj.edu.pl, baryluk at mpi.int.pl
JID: movax at jabber.autocom.pl



More information about the Digitalmars-d mailing list