Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.misc > #1498

Re: should we Go now?

From Ivan Shmakov <oneingray@gmail.com>
Newsgroups comp.lang.misc, comp.lang.perl.misc
Subject Re: should we Go now?
Followup-To comp.lang.misc
Date 2013-02-25 13:12 +0000
Organization Aioe.org NNTP Server
Message-ID <878v6c8rl2.fsf@violet.siamics.net> (permalink)
References <87hal29eeb.fsf@violet.siamics.net> <87ehg5u0r3.fsf@sapphire.mobileactivedefense.com> <874nh1abn5.fsf@violet.siamics.net> <a8zWs.286345$zu7.131490@fx01.fr7>

Cross-posted to 2 groups.

Followups directed to: comp.lang.misc

Show all headers | View raw


>>>>> BartC  <bc@freeuk.com> writes:
>>>>> "Ivan Shmakov" <oneingray@gmail.com> wrote in...

	[Dropping news:comp.lang.perl.misc from Followup-To:.]

[...]

 >>> the lexer always inserts a semicolon after the token.  This could
 >>> be summarized as, "if the newline comes after a token that could
 >>> end a statement, insert a semicolon".

 > I use a similar rule, and at one time it was very simple: semicolons
 > are inserted unless the last token is a comma, or line-continuation
 > is used.  (Some tolerance of superfluous semicolons is also needed.)

	The idea isn't new.  Consider, e. g.:

--cut: http://www.gnu.org/software/gawk/manual/html_node/Statements_002fLines.html --
    However, gawk ignores newlines after any of the following symbols
    and keywords:

      ,    {    ?    :    ||    &&    do    else

    A newline at any other point is considered the end of the
    statement.^1
--cut: http://www.gnu.org/software/gawk/manual/html_node/Statements_002fLines.html --

[...]

 >> Thus, my earlier "? :" example as it is is impossible here, and so
 >> is my preferred style of lining the operators up like:

 >> a = (b
 >>      + c
 >>      + d * e);

 > Does Go have line-continuation?

	I believe it doesn't.

	Patching the lexer to count parenthesis and brackets doesn't
	seem like a particularly bright idea, but it might worth trying
	doing it that way.

	Alternatively, I may try to teach the all-mighty Emacs to show
	the code formatted in my style, while it would be stored in the
	one chosen by the Go designers.  (I need a similar trick for
	XML, anyway, as otherwise indentation level changes tend to
	waste a plenty of diff-space.)

 > It's not pretty, but will allow your style of coding.

	Thus, my Go programs are likely to end up having more
	line-continuations than my similar C (or Perl, for that matter)
	ones would have semicolons...

-- 
FSF associate member #7257

Back to comp.lang.misc | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

should we Go now? Ivan Shmakov <oneingray@gmail.com> - 2013-02-24 10:47 +0000
  Re: should we Go now? Ben Morrow <ben@morrow.me.uk> - 2013-02-24 13:40 +0000
  Re: should we Go now? Rainer Weikusat <rweikusat@mssgmbh.com> - 2013-02-24 16:37 +0000
    Re: should we Go now? Ivan Shmakov <oneingray@gmail.com> - 2013-02-24 17:02 +0000
      Re: should we Go now? Rainer Weikusat <rweikusat@mssgmbh.com> - 2013-02-24 19:38 +0000
        Re: should we Go now? Nils M Holm <news2009@t3x.org> - 2013-02-25 07:23 +0000
          Re: should we Go now? Rainer Weikusat <rweikusat@mssgmbh.com> - 2013-02-25 17:30 +0000
      Re: should we Go now? Ben Morrow <ben@morrow.me.uk> - 2013-02-24 21:42 +0000
        Re: should we Go now? Rainer Weikusat <rweikusat@mssgmbh.com> - 2013-02-24 22:26 +0000
        Re: should we Go now? Rainer Weikusat <rweikusat@mssgmbh.com> - 2013-02-25 01:04 +0000
        Re: should we Go now? Ivan Shmakov <oneingray@gmail.com> - 2013-02-25 13:32 +0000
          Re: should we Go now? Ben Morrow <ben@morrow.me.uk> - 2013-02-25 15:28 +0000
            Re: should we Go now? Rainer Weikusat <rweikusat@mssgmbh.com> - 2013-02-25 17:54 +0000
      Re: should we Go now? "BartC" <bc@freeuk.com> - 2013-02-25 01:29 +0000
        Re: should we Go now? Ivan Shmakov <oneingray@gmail.com> - 2013-02-25 13:12 +0000
  Re: should we Go now? Ivan Shmakov <oneingray@gmail.com> - 2013-02-24 17:04 +0000
  Re: should we Go now? Bjoern Hoehrmann <bjoern@hoehrmann.de> - 2013-02-24 18:24 +0100
  Re: should we Go now? Keith Thompson <kst-u@mib.org> - 2013-02-25 17:01 -0800

csiph-web