LISP = Lost in Stupid Parenthesis

 I am actually working on an Excel formula, and believe it is not working because I have not successfully located the parenthesis in the correct spots.  This sort of problem is also common to the LISP programming language. 

Many years ago I recall seeing some editors that did a better job of showing how the parenthesis matched.  One I recall seeing would underline each level of parenthesis, so that an inner set might have several underlines.  Each level was raised a bit, so that it was very easy to see each level.  But, I have not been able to find it again.

I already have Notepad ++, which will has a few features to help match parentheses, but it is not really as good as what I described above. Any suggestions for freely available LISP editors? 

-Joe

Comments

  • I just tried to manually recreate what I recall about the LISP editor I recall. Though, it has been MANY years, so my memory may not be totally accurate.  I pasted the text into BricsCAD and exploded the text using the Express Tools. Then, manually edited as the attached screen grab shows.


    imageColored matching parenthesis.JPG
  • Joe,

    I haven't seen an editor like what you describe.  I use a stand-alone program named ParenMatch for this, but it does not seem to be stores on the internet anymore.  "This utility color-codes left-hand parenthesis with matching right-hand ones in your LISP code, making it easy to identify mismatched parenthesis."  It was free code but it is copyrighted so I can't post it here.  Are you a member at theswamp.org or at augi.com?  You could PM an email address to me [HMSPE at either site] and I could send a copy.  
  • In the past I used Emerald Editor, which is still available and free: http://www.emeraldeditor.com/
    It will show you the closing parenthesis if you place your cursor on the opening parenthesis (see attached screen capture). Not as elegant as vlide, but does the job. I keep hearing rumors that BricsCAD will offer its own lisp editor some day. Let's hope, but in the meantime UltraEdit is great tool if you have an extra $80.
    Good luck.
    imageEmeralEditor.png
  • We just UltraEdit for most of our lisp/html/programming needs.  Lining up Parenthesis couldn't be easier.  Not free, but well worth it.

    It also has settings to default highlight different code sections depending on which code you're developing in.  Autocomplete/etc/etc.
    imageparens(2).png
  •  Another alternative: gvim (graphical vi improved). Pros: free, has syntax coloring for Lisp (and more other languages than you knew existed), does parenthesis matching by highlighting or by jump-to-match. Cons: it's vi (if you don't already know vi, else that's a Pro ;-)
  • With Notepad++ you can also achieve what is shown in the image in post #5.
    I think that Joe does not want to use multiple indented lines.
  • Like so?

    Side note: I really wish we could edit posts we've already created.  :(
    imageparens3.png
  • Yes Chris. In fact all the feature you have mentioned are available in Notepad++.
    What NP++ does not have is syntax highlighting based on regular expressions. UltraEdit does.
  • NP++ screenshot:
    imageNP++.png
  • Dear All,

    just an addition to UltraEdit - the "Lisp Developer Support Package" (see AppCatalog) also contains extended AutoLISP language definition files, so AutoComplete etc. are also available for AutoLISP specific functions ...
    and that language file also contains "Funtion List" definitions, to quickly show all defun and command names with arguments ...
    so another (little) detail for easier navigation.

    many greetings !
  •  I am actually working on an Excel formula, and believe it is not working because I have not successfully located the parenthesis in the correct spots.


    Going back to the OP, In Excel long formulae can be almost impossible to debug. A technique to combat this is to break the formula up over several cells. This allows you to narrow down where an issue may be coming from. These component cells can be hidden so that you only show the resultant cell, or once you have debugged you can combine to a single cell superformula.

    Another useful feature is to name things like ranges, and input parameters. This allows you to use visualise the formula more easily. e.g.  'mydata'!A$1$:G$20$ could be named as 'StreetName', which makes it a lot easier recognise.

    Regards,
    Jason Bourhill

  •  Thank you all for all the excellent recommendations.  

    The simple coloring of the matching parenthesis is not very easy for me to see.

    Excel already has parenthesis matching, by highlighting the matching parenthesis like NotePad ++ does.  But it just wasn't clear enough for me to see.  I was about to blame it on my age, but then remembered that monitors are much higher resolution, than when I first started using a computer, an Atari 8-bit with a TV as a monitor.  Of course, professionally I started using CAD oh a much higher resolution screen.  A 640x480 display.  With High Def screens, fonts can be finer, and therefore harder to detect the color of a parenthesis.  I did find a way to make the formula area larger, and that helped a bit.

    I just revisited NotePad ++, and it is definitely is clearer to see than Excel.  Though, I actually solved the problem by dissecting the formula and putting parts of it in different cells.
    But, I have decided to do as Jason Bourhill suggested.  I will break up the functions into different cells, and put some of the spreadsheet on another tab, so that it is not cluttering the main interface. Otherwise any future edits will repeat the headaches I had with this current formula.

    -Joe
  • If you have trouble identifying highlighted braces, you can try changing the 'Brace highlight style' in NP++.
    Settings > Style Configurator... > Language: Global Styles > Style: Brace highlight style
  •  Thank you Roy.  I was unaware that this could be customized in NotePad ++.  For the highlighted parenthesis you can choose the font, font size, color, etc.  It helps a lot. 

    I know we can tend to complain when a program has a complicated interface, and a zillion parameters.  It can be difficult to find a particular parameter, because you both have to know it is even possibility and then the right words to use for the search. But, if you want to customize stuff, it takes complexity, and a steep learning curve to get a grasp of it.

    I still think the example I gave from the program I saw years ago is a better approach, since it makes the entire structure clear at once glance.

    -Joe
  • UltraEdit is the way to go. I use it for my lisp and python programming. The syntax highlighting, parenthesis matching, smart templates, multi-caret editing all make life a lot easier. It's well worth a lot more than they charge for it.....

    Youtube-UltraEdit

    -KS
  •  I found some Excel specific solutions.   They put the formula into a format familiar with  those who do computer programming.



    Though, I have not evaluated them yet. Perhaps the next time I have a difficult formula, I will check them out.

    -joe
  • LispLink looks great. I can't find any way to do all that with Notepad++
    But I have v6.1.5. Maybe a newer version would be able to.

    Unfortunately, the CAE-Link web site says they're closing the company due to the death of the founder.


This discussion has been closed.