Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

why parens aren't like HTML

 
author & internet detective
Posts: 40796
828
Eclipse IDE VI Editor Java
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I wrote about why parens in LISP aren't like HTML. And then concluded with that they are a bit.

In case I didn't manage to cover all the positions, any more?
 
Bartender
Posts: 2407
36
Scala Python Oracle Postgres Database Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Slava Akhmechet had a good ramble around this topic a while ago on his defmacro blog, e.g. converting Ant XML tasks into Lispy looking S-expressions, etc.

I had no real problem with the parens thing - much less typing than HTML/XML - and most editors will keep track of them, indent and even colour-code them for you. Anyway, even HTML etc will try to ditch the closing tag if there are no children e.g. <foo blah="bar"></foo> is the same as <foo blah="bar " />.

How are you enjoying the course, by the way?
 
Jeanne Boyarsky
author & internet detective
Posts: 40796
828
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Someone in the course posted a link to c2 which has a good discussion on the matter.

I'm liking the course. It is extremely well organized. And they added overlays to the videos to clarify things from the first run.
 
Jeanne Boyarsky
author & internet detective
Posts: 40796
828
Eclipse IDE VI Editor Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I got permission to cross post my classmate's entire post:

I think the typical comparison of Lisp symbolic expressions (s-exprs) is with XML and not with HTML.

There was a pretty big hullabaloo some years back, just when XML was becoming a buzzword technology, comparing XML to s-exprs. Famously, Erik Naggum's anti-XML rant is always fun to read. The guys over at C2 also have some fairly extensive discussions on this matter.

Interestingly, your defense of closing tags echoes Paul Prescod's defense of XML, the only Pro-XML response I've ever been able to find. Unfortunately the link appears to be broken, and I can't find any mirrors.

My own opinion on the matter is this (just scattered thoughts):
As a programmer, both as a reader and as a writer of code, I've never found parentheses to be a problem. By contrast, the verbosity caused by Lisp's lack of syntax does impact the clarity of code.
A good editor will automatically tell you which parenthesis you are closing, and even automatically indent your code. Losing context is not something I have ever had trouble with.
When working with data, it is a very powerful idea to be able to directly write an in-memory data structure into a human readable structured text document, and then to read it back in again into a format that can be directly manipulated by your language. In Lisp, the idea can be even more powerful since your input file can even be directly processed using the full might of the lisp reader/interpreter. By contrast, I've never found an XML library that didn't leave me cursing its inventors and all of their ancestors. Retrieving data by manipulating an XML DOM or XPath is incredibly clunky and ugly.

EDIT: You can read Paul's article here, courtesy the Wayback Machine.

 
Bartender
Posts: 1810
28
jQuery Netbeans IDE Eclipse IDE Firefox Browser MySQL Database Chrome Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A warning to those at work. Don't click that "anti-XML rant" link. Our BlueCoat proxy blocked it as a pornographic site.

I'm probably going to get a nasty-gram from corporate security now.
 
Bartender
Posts: 4568
9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
When I was doing that course, I found the parentheses relatively easy to get used to (with a decent editor, which DrRacket is). And the ability to use [] as well as () (with the interpreter making sure they match) also helped. A bigger step, I found, was getting used to prefix notation. In particular with non-commutative operators.

So, for instance, (+ (a b)) is OK. But I have a really hard time telling my brain that (- (a b)) doesn't have a -a in it.
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic