Top
Best
New

Posted by mighty-fine 1 day ago

Inverse Parentheses(kellett.im)
70 points | 63 commentspage 2
munchler 1 day ago|
Prompt: Suggest a topic for a short blog post that will nerd-snipe as many readers as possible while making no actual sense at all.

System: How about “Inverse Parentheses”? We can write the entire article without ever defining what it means. Nerds will be unable to resist.

Nevermark 1 day ago||
I am in the middle of developing a parser for a new language with original representation vs. syntax issues to resolve.

Clearly, this was the worst possible time for me to come across this brain damaging essay.

I really can’t afford it! My mathematical heart can’t help taking symmetrical precedence control seriously. But my gut is experiencing an unpleasant form of vertigo.

tonnydourado 1 day ago||
The footnotes are top-tier ADHD. Particularly loved the footnote on a footnote, 10/10.
teo_zero 1 day ago||
The real question is, why does Python even have parentheses? If semantic indent is superior to braces, it ought to beat parentheses, too. The following should yield 14:

  a = 2 *
    3 + 4
kazinator 19 hours ago|
Also, don't forget that python has;

  list = [
    1,2,3,
    [ 4, 5 ],
    6
  ]
Without this Python would basically have to be Yaml-ish Lisp:

  =
    a
    *
      2
      +
        3
        4
Let's drop the leading Yaml dashes needed to make ordered list elements. So we have an = node (assignment) which takes an a destination, and a * expression as the source operand. *'s operands are 2 and a + node, whose operands are 3 and 4.
pxeger1 1 day ago||
I don't understand
cubefox 1 day ago||
Slightly unrelated:

Instead of ordinary brackets, one can also use the dot notation. I think it was used in Principia Mathematica or slightly later:

  (A (B (C D)))
would be

  A . B : C .: D
Essentially, the more dots you add, the stronger the grouping operator is binding. The precedence increases with the number of dots.

However, this is only a replacement for ordinary parentheses, not for these "reverse" ones discussed here. Maybe for reverse, one could use groups of little circles instead of dots: °, °°, °°°, etc.

agalunar 23 hours ago||
I believe Peano dot notation works the other way ’round;

  A . B : C :. D
would be, as I understand it, equivalent to:

  ((A B) C) D
The “general principle” is that a larger number of dots indicates a larger subformula.¹

What if you need to nest parentheses? Then you use more dots. A double dot (:) is like a single dot, but stronger. For example, we write ((1 + 2) × 3) + 4 as 1 + 2 . × 3 : + 4, and the double dot isolates the entire 1 + 2 . × 3 expression into a single sub-formula to which the + 4 applies.²

A dot can be thought of as a pair of parentheses, “) (”, with implicit parentheses at the beginning and end as needed.

In general the “direction” rule for interpreting a formula ‘A.B’ will be to first indicate that the center dot “works both backwards and forwards” to give first ‘A).(B’, and then the opening and closing parentheses are added to yield ‘(A).(B)’. The extra set of pairs of parentheses is then reduced to the formula (A.B).³

So perhaps one way of thinking about it is that more dots indicates more separation.

¹ https://plato.stanford.edu/entries/pm-notation/dots.html

² https://blog.plover.com/math/PM.html

³ https://plato.stanford.edu/entries/pm-notation/dots.html

See also https://plato.stanford.edu/entries/pm-notation/index.html and https://muse.jhu.edu/article/904086.

cubefox 21 hours ago||
Oh you are right, more dots indicate lower operator precedence (weaker binding), not the other way round. Though the explanations you cited seem confusing to me. Apparently by non-programmers.
agumonkey 1 day ago||
could this be the origin of lisp and ML family list notation ?
ofalkaed 1 day ago||
Parenthesis used to decrease precedence? Everything outside of the parenthesis will be done before what is in the parenthesis?
Lerc 1 day ago||
I think reading this let me experience the feeling a Bene Gesserit has when they hear about a preborn.
TeodorDyakov 1 day ago||
Where do stars live? Thats what I wonder.
tromp 1 day ago|
Using Brave on MacOS, I cannot scroll the page to see the entire text. On Firefox, it scrolls fine.
guessmyname 1 day ago||
Same in Safari. It has something to do with the

  :root {
    […]
    overflow: hidden scroll;
    container-type: size;
    […]
  }
in the main CSS file: https://kellett.im/theme/main.css
auggierose 1 day ago|||
Cannot scroll on Safari on macOS, either. What also doesn't work is making the font smaller / larger.
TerraHertz 1 day ago||
Splendid. Someone found a way to break Browser Scrolling. (Firefox 115.16 for Win7)

Well done.

More comments...