开发者

How to change your keyboard key of square brackets to parentheses in DrRacket?

The square brackets are next to the button 'P' and before 'Enter'. So I want to change them so that I can use them as parentheses instead of square brackets. It is easier to type that way.

I also found the answer but let the people kno开发者_高级运维w in advance.

Preferences -> Editing -> Scheme or Racket -> (check) Automatically adjust opening square brackets.


I don't believe you can configure Dr. Racket to this. Try changing it for your specific operating system.

On the other hand, the Racket reader does not differentiate between square brackets, parentheses, and curly braces. However, it is considered common practice to differentiate them while you're writing code. For instance, the proper way to write a variable assignment is:

(let ([var1 value1] 
      [var2 value2]) 
   body)

In particular, there are a number of extra Dr. Racket key-bindings which exist to make your life as a programmer easier. Try, for instance hitting Alt+(, really, Meta+(, or the sequence "ESC; (", and you will get a balanced set of parentheses with the cursor placed inside. Same thing goes for brackets and curly braces.

For a list of all such bindings, go to Edit -> Keybindings -> Show Active Keybindings.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜