Question about parentheses

Whatever is on your mind, whether Lisp related or not.
Warren Wilkinson
Posts: 117
Joined: Tue Aug 10, 2010 11:24 pm
Location: Calgary, Alberta
Contact:

Re: Question about parentheses

Post by Warren Wilkinson » Wed Sep 08, 2010 10:39 pm

Learning a new keyboard layout requires you to do touch typing exercises all over again. While you are learning, you will feel crippled (seriously), it takes about a month of daily practice before you are comfortable with the keys. You'll still make mistakes (lots of them) but you'll now find guess and check faster than looking at your reference keyboard cheat sheet.
Need an online wiki database? My Lisp startup http://www.formlis.com combines a wiki with forms and reports.

TheGZeus
Posts: 79
Joined: Mon Jun 30, 2008 10:46 am

Re: Question about parentheses

Post by TheGZeus » Fri Sep 10, 2010 2:21 am

I didn't ever do touch-typing exercises, not intentionally anyway.
In fact, seeing as I'm dysgraphic, those touch-typing exercises they had me doing were systematic in a way that left me spelling things weirdly until I got off qwerty.

nuntius
Posts: 538
Joined: Sat Aug 09, 2008 10:44 am
Location: Newton, MA

Re: Question about parentheses

Post by nuntius » Fri Sep 10, 2010 6:34 am

FWIW, I tried Colemak for less than an hour last night. By the end, I could type the alphabet from a-z with only a few mistakes. Definitely easier to learn than Dvorak. Colemak has many keys matching qwerty and several easy patterns like "rst" and "jklmn"; u and y almost make sense in relation to the other keys. Not yet ready to switch (especially for passwords) but I'll try to keep practicing.

Jonsul
Posts: 18
Joined: Mon Apr 19, 2010 7:56 am

Re: Question about parentheses

Post by Jonsul » Sun Sep 12, 2010 10:13 pm

Since I've posted I've discovered Racket which has "{" and "[" all equivalent to "(". Which is nice because I can use either at the same time so it allows me to organize my code more.

findinglisp
Posts: 447
Joined: Sat Jun 28, 2008 7:49 am
Location: Austin, TX
Contact:

Re: Question about parentheses

Post by findinglisp » Tue Sep 14, 2010 4:38 pm

Jonsul wrote:Since I've posted I've discovered Racket which has "{" and "[" all equivalent to "(". Which is nice because I can use either at the same time so it allows me to organize my code more.
Personally, this is a nightmare for me. When editing, you're bound to get something unbalanced and then it's a pain (either the implementation barfs or what you think is structure is suddenly untrustworthy, leading to bugs). IMO, use indentation for structure and organization, and ignore the parentheses altogether. But that's just me. There was a time when the ability to do that would have appealed to me (when I still "saw" parentheses). I understand the appeal.
Cheers, Dave
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/

gugamilare
Posts: 406
Joined: Sat Mar 07, 2009 6:17 pm
Location: Brazil
Contact:

Re: Question about parentheses

Post by gugamilare » Tue Sep 14, 2010 5:51 pm

findinglisp wrote:
Jonsul wrote:Since I've posted I've discovered Racket which has "{" and "[" all equivalent to "(". Which is nice because I can use either at the same time so it allows me to organize my code more.
Personally, this is a nightmare for me. When editing, you're bound to get something unbalanced and then it's a pain [...]
I guess you usually can't get something unbalanced using Paredit. But this would be bad for me, too. I'm used "not to see" parenthesis, but rather to see indentation. If you alternate between {, [ and (, you'll create irregularities in the code that your brain won't ignore. Lisp code is so clean compared to other languages! Plus, the difference between { and ( is not easily seen, for instance:

Code: Select all

)}})))})}))})

findinglisp
Posts: 447
Joined: Sat Jun 28, 2008 7:49 am
Location: Austin, TX
Contact:

Re: Question about parentheses

Post by findinglisp » Thu Sep 16, 2010 8:19 pm

gugamilare wrote:
findinglisp wrote:
Jonsul wrote:Since I've posted I've discovered Racket which has "{" and "[" all equivalent to "(". Which is nice because I can use either at the same time so it allows me to organize my code more.
Personally, this is a nightmare for me. When editing, you're bound to get something unbalanced and then it's a pain [...]
I guess you usually can't get something unbalanced using Paredit. But this would be bad for me, too. I'm used "not to see" parenthesis, but rather to see indentation. If you alternate between {, [ and (, you'll create irregularities in the code that your brain won't ignore. Lisp code is so clean compared to other languages! Plus, the difference between { and ( is not easily seen, for instance:

Code: Select all

)}})))})}))})
Paredit is definitely the way to go, but even Paredit gets unbalanced sometimes with heavy editing and various other Emacs commands thrown in. It's much nicer to be able to fix that by just inserting a ")" somewhere, rather than having to try to figure out whether you need to balance a ")", "]" or "}". And as you rightly point out, they actually aren't very visually different (though this is somewhat font dependent and the font used in LispForum makes this worse).
Cheers, Dave
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/

Jonsul
Posts: 18
Joined: Mon Apr 19, 2010 7:56 am

Re: Question about parentheses

Post by Jonsul » Thu Sep 16, 2010 11:54 pm

Unbalanced code isn't really a problem at all. Because DrRacket automatically balances it no matter what you type. If you type "[cons 'a '(b c)" when you close cons it'll put a "]" whether you type ")" or "}". Plus the big plus to me isn't clarity in the brackets it was just a side I listed. I have a bit of carpel tunnel so the difference between a two key push vs a pinky push is big. My hand gets tired and sore after typing so many parenthesis. Plus I don't really mix brackets much anyways, the ends of my functions typically end like this:

Code: Select all

]]]]]]

But anyways I've fixed the problem for me at least a little bit. I've created my first utility to make it easier for me, and others that are interested, to program in Common Lisp. I made Parent, give it your code file in the command-line and it converts square brackets and curly brackets into parenthesis. Also if your not interested check it out and tell me what you think. It's my first fully polished program in Scheme. It's made on linux so I'm not sure how clear it is on windows.

http://ifile.it/r7x1gtd

By the way, it's programmed in pure R6RS if you want to check out the code.

Post Reply