Question about parentheses
-
- Posts: 117
- Joined: Tue Aug 10, 2010 11:24 pm
- Location: Calgary, Alberta
- Contact:
Re: Question about parentheses
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.
Re: Question about parentheses
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.
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.
Re: Question about parentheses
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.
Re: Question about parentheses
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.
-
- Posts: 447
- Joined: Sat Jun 28, 2008 7:49 am
- Location: Austin, TX
- Contact:
Re: Question about parentheses
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.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.
Cheers, Dave
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/
-
- Posts: 406
- Joined: Sat Mar 07, 2009 6:17 pm
- Location: Brazil
- Contact:
Re: Question about parentheses
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:findinglisp wrote:Personally, this is a nightmare for me. When editing, you're bound to get something unbalanced and then it's a pain [...]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.
Code: Select all
)}})))})}))})
-
- Posts: 447
- Joined: Sat Jun 28, 2008 7:49 am
- Location: Austin, TX
- Contact:
Re: Question about parentheses
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).gugamilare wrote: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:findinglisp wrote:Personally, this is a nightmare for me. When editing, you're bound to get something unbalanced and then it's a pain [...]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.Code: Select all
)}})))})}))})
Cheers, Dave
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/
Slowly but surely the world is finding Lisp. http://www.findinglisp.com/blog/
Re: Question about parentheses
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:
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.
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.