Back to index
Parentheses Hack
This little hack solves a problem that several people had reported:
Entering non-trivial programs is troublesome as you can get lost
in Lots of Irritating Silly Parentheses.
Parentheses Hack tries to remedy this problem by highlighting the
matching opening parenthesis when entering a closing one. Additionally
it can match parentheses in existing code.
This works both in the LispMe input field and in MemoPad (that's the
reason it's written as a hack!), and in fact in any Pilot application
using entryfields.
- Just input your code (Graffiti or keyboard doesn't matter). When
entering a closing parenthesis, the corresponding opening is
highlighted for a short time. When there's no matching opening
parenthesis, a beep is played.
- To match parentheses in existing code, you have to select a
(opening or closing) parenthesis with the stylus. Make sure that
only the parenthesis is highlighted and not any adjacent character.
Now write the letter o or the digit 0 and the
other matching
parenthesis is highlighted. Another o and you are back.
Or write an s or 5 and the entire text between the current and
the matching parenthesis will be selected.
Writing any other char will overwrite the current selection (as
usual), simpy use Undo when this happened accidentially.
Parentheses Hack knows LispMe's syntax and won't be fooled by parentheses
in strings, comments or character constants it encounters when searching
the matching one. It will simply beep when trying to match a parenthesis in a
comment or string.
Hacks and PalmOS5
Unfortunately, PalmOS5 doesn't support hacks anymore. To remedy this situation,
LispMe now includes an option in the
Global Settings dialog
for matching parens within LispMe itself, just like Parentheses Hack.
Of course, this means that matching will work
with LispMe's internal editor only, and no more with an external editor.