Indentation

59 views
Skip to first unread message

Shivkumar Chandrasekaran

unread,
Apr 27, 2017, 9:34:30 AM4/27/17
to ats-lang-users
I have noticed that ATS code posted here is no longer indented making it impossible to find where a block begins and ends. Am I missing something? May be a special editor mode? Thanks. --shiv--

Hongwei Xi

unread,
Apr 27, 2017, 10:14:36 AM4/27/17
to ats-lan...@googlegroups.com
I guess I am guilt of it.

I may have some sort of psychological aversion to indentation :)
I tend to use comments to indicate the beginning and ending of a
block.

Just want to say a few words on coding style before closing the message:

I like type-annotation a lot.

Using parentheses around an expression
and then adding a type-annotation is a very good style to me. See:

val =
(
case+ ... of
| ...
| ...
) : some-type

Also, run-time checks work really great:

val () = assertloc(...)

I tend to spread such run-time checks in my code (when I feel proving is
a bit too expensive for the moment).

On Thu, Apr 27, 2017 at 9:34 AM, Shivkumar Chandrasekaran <00s...@gmail.com> wrote:
I have noticed that ATS code posted here is no longer indented making it impossible to find where a block begins and ends. Am I missing something? May be a special editor mode? Thanks. --shiv--

--
You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-users+unsubscribe@googlegroups.com.
To post to this group, send email to ats-lang-users@googlegroups.com.
Visit this group at https://groups.google.com/group/ats-lang-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/ats-lang-users/81b5be89-c321-4440-ba46-20bc82ea7178%40googlegroups.com.

Shiv

unread,
Apr 29, 2017, 10:25:55 AM4/29/17
to ats-lan...@googlegroups.com
Hi Hongwei,
I think you have a really deep mental stack! For example, in this article of yours http://ats-lang.sourceforge.net/EXAMPLE/EFFECTIVATS/linear-streams/main.html, I pretty much have to cut and paste the code into emacs, re-indent it, and then read it, just to figure out where the various internal functions test and extend ended and where the main expression was. I also have the same difficulty parsing out where the static variables and dynamic variables are for each function declaration. May be over time I will get used to your style.
Thanks.
--shiv--

On Thu, Apr 27, 2017 at 7:14 AM Hongwei Xi <gmh...@gmail.com> wrote:
I guess I am guilt of it.

I may have some sort of psychological aversion to indentation :)
I tend to use comments to indicate the beginning and ending of a
block.

Just want to say a few words on coding style before closing the message:

I like type-annotation a lot.

Using parentheses around an expression
and then adding a type-annotation is a very good style to me. See:

val =
(
case+ ... of
| ...
| ...
) : some-type

Also, run-time checks work really great:

val () = assertloc(...)

I tend to spread such run-time checks in my code (when I feel proving is
a bit too expensive for the moment).
On Thu, Apr 27, 2017 at 9:34 AM, Shivkumar Chandrasekaran <00s...@gmail.com> wrote:
I have noticed that ATS code posted here is no longer indented making it impossible to find where a block begins and ends. Am I missing something? May be a special editor mode? Thanks. --shiv--

--
You received this message because you are subscribed to the Google Groups "ats-lang-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.

--
You received this message because you are subscribed to a topic in the Google Groups "ats-lang-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/ats-lang-users/6ToDrDR5scg/unsubscribe.
To unsubscribe from this group and all its topics, send an email to ats-lang-user...@googlegroups.com.
To post to this group, send email to ats-lan...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages