Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #5065 > unrolled thread
| Started by | luser droog <mijoryx@yahoo.com> |
|---|---|
| First post | 2015-01-09 09:35 -0800 |
| Last post | 2015-01-09 22:04 +0100 |
| Articles | 4 — 4 participants |
Back to article view | Back to comp.programming
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
| From | luser droog <mijoryx@yahoo.com> |
|---|---|
| Date | 2015-01-09 09:35 -0800 |
| Subject | Eliding parens |
| Message-ID | <9937fe04-b237-4025-b702-17b33963ee4b@googlegroups.com> |
My investigations of the roots of algebraic/polish syntaxes
has led me to two papers from the 60s which describe three
systems of parenthesizing algebraic expressions.
http://www.mt-archive.info/Oettinger-1961.pdf
http://mt-archive.info/IFIP-1965-Oettinger.pdf
The one we know and love is the "fully-parenthesized" form.
But apparently you can also just ignore half of them and
only consider the left- or right- hand braces.
Which leads me to imagine a hybrid system where certain
redundant parens may be omitted, particularly ones on the
edge of the expression.
eg.
(x+y)*z+(w/t)
could be
x+y)*z+(w/t
For lisp-type languages, this would mean never having to
count parens in order to close everything. It's just extra
redundant book-keeping.
amiright?
[toc] | [next] | [standalone]
| From | Mark Carroll <mtbc@bcs.org> |
|---|---|
| Date | 2015-01-09 17:39 +0000 |
| Message-ID | <87r3v3q2e2.fsf@ixod.org> |
| In reply to | #5065 |
luser droog <mijoryx@yahoo.com> writes: > For lisp-type languages, this would mean never having to > count parens in order to close everything. It's just extra > redundant book-keeping. True, but with a decent IDE one doesn't really have to count them anyway: closing one makes it clear which opening one is thus being closed, and auto-indent is extra help / confirmation. This is very much why one doesn't write Lisp using Notepad. (-: -- Mark
[toc] | [prev] | [next] | [standalone]
| From | Kaz Kylheku <kaz@kylheku.com> |
|---|---|
| Date | 2015-01-09 18:50 +0000 |
| Message-ID | <20150109104521.23@kylheku.com> |
| In reply to | #5065 |
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.
[toc] | [prev] | [next] | [standalone]
| From | Sjouke Burry <burrynulnulfour@ppllaanneett.nnll> |
|---|---|
| Date | 2015-01-09 22:04 +0100 |
| Message-ID | <54b04250$0$20832$703f8584@textnews.kpn.nl> |
| In reply to | #5065 |
On 09.01.15 18:35, luser droog wrote: > My investigations of the roots of algebraic/polish syntaxes > has led me to two papers from the 60s which describe three > systems of parenthesizing algebraic expressions. > http://www.mt-archive.info/Oettinger-1961.pdf > http://mt-archive.info/IFIP-1965-Oettinger.pdf > > The one we know and love is the "fully-parenthesized" form. > But apparently you can also just ignore half of them and > only consider the left- or right- hand braces. > > Which leads me to imagine a hybrid system where certain > redundant parens may be omitted, particularly ones on the > edge of the expression. > > eg. > (x+y)*z+(w/t) > could be > x+y)*z+(w/t > > For lisp-type languages, this would mean never having to > count parens in order to close everything. It's just extra > redundant book-keeping. > > amiright? > No. Just lazy.
[toc] | [prev] | [standalone]
Back to top | Article view | comp.programming
csiph-web