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


Groups > comp.programming > #5069

Re: Eliding parens

From Kaz Kylheku <kaz@kylheku.com>
Newsgroups comp.programming
Subject Re: Eliding parens
Date 2015-01-09 18:50 +0000
Organization Aioe.org NNTP Server
Message-ID <20150109104521.23@kylheku.com> (permalink)
References <9937fe04-b237-4025-b702-17b33963ee4b@googlegroups.com>

Show all headers | View raw


On 2015-01-09, luser droog <mijoryx@yahoo.com> wrote:
> For lisp-type languages, this would mean never having to
> count parens in order to close everything.

Historically, there existed in some Lisp dialects a "super bracket".

That is to say, you can have a hierarchy of parentheses with different powers.

We can illustrate this with two levels: the regular parentheses () and
the super parentheses []:

  [defun foo (x)
    (if (> x 1) "greater than one"]

The ] parenthesis closes all the open ( parentheses up to the previous matching
[ parenthesis.  There is no counting of outstanding ( parentheses required on
the part of the coder.

Now you could make it so that you only have one kind of parenthesis, and the
language simply doesn't care about unbalanced parentheses.  But that makes it
difficult to find errors in programs.

If you write a function and do not close it, then subsequent functions are
being defined inside that function. The source file then ends and there is no
diagnostic.

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Eliding parens luser droog <mijoryx@yahoo.com> - 2015-01-09 09:35 -0800
  Re: Eliding parens Mark Carroll <mtbc@bcs.org> - 2015-01-09 17:39 +0000
  Re: Eliding parens Kaz Kylheku <kaz@kylheku.com> - 2015-01-09 18:50 +0000
  Re: Eliding parens Sjouke Burry <burrynulnulfour@ppllaanneett.nnll> - 2015-01-09 22:04 +0100

csiph-web