Arc Forumnew | comments | leaders | submitlogin
Indent delimiters instead of parentheses
2 points by valtih1978 4011 days ago | 4 comments
In the faq, you explain Why not use some other delimiter than parentheses:

"We tried various possibilities. Square and curly brackets lose because they are less directional than parens (left and right differ in fewer pixels); < and > lose because they don't wrap around enough to enclose expressions longer than tokens."

I do not understand anything. Why to consider replacing () with [] and <>? Despite for lexer they may look different, these are the same delimiters. You should not be a language designer to understand that! What a kidding? Secondly, I do not see the most radical alternative in your consideration list: the Tabs, successfully used in Python.

You must strip of the parenthesis certainly simply because LISP code is indented anyway making parenthesis purely redundant whereas you are purist struggling for minimalism.



3 points by fallintothis 4011 days ago | link

http://arclanguage.org/item?id=1917

http://arclanguage.org/item?id=2003

-----

3 points by akkartik 4011 days ago | link

Holy crap, how have I never heard of noparen.arc? I'm gonna see how PG's design choices were different from mine in http://akkartik.name/post/wart. Did I do something he didn't consider, or did he dismiss my approach for aesthetic reasons?

Edit 11 minutes later: Ugh, he's relying on keyword names like a vim or emacs mode. So any new macros would need to be manually added to the right global variable. Contrast https://github.com/akkartik/wart/blob/83f228b547/004optional...

And he seems to also have been trying to translate f(a) syntax.

-----

2 points by fallintothis 4011 days ago | link

Ugh, he's relying on keyword names like a vim or emacs mode. So any new macros would need to be manually added to the right global variable.

"Ugh" is right. :) I think this is also a major problem with pprint.arc. A similar issue arose in https://bitbucket.org/fallintothis/contract/src/d1b4ff38afaf...

In the past I've tried to think about ways to handle it automatically, but I usually get hung up on macros and their pesky propensity for undoing assumptions. E.g., for my Vim ftplugin (https://bitbucket.org/fallintothis/arc-vim), I used the heuristic "is the macro's rest parameter named body?" to figure out the indentation of so-called "bodops"...except that I had to manually maintain white/blacklists of troublesome macros with code similar to http://arclanguage.org/item?id=11288

-----

1 point by akkartik 4011 days ago | link

Took me a while to realize you were referring to http://www.paulgraham.com/arcfaq.html. Hadn't read it in a while; thanks!

-----