TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

M-expressions==LISP in "normal syntax"-kills LISP?

2 pointsby globalrevalmost 17 years ago
http://en.wikipedia.org/wiki/M-expression<p>if i understand it right M-expressions would make it possible to have a LISP without parenthesis?<p>well what a lot of people love about LISP is macros and that code is data and data is code.<p>if someone rewrote LISP to have "normal" syntax and notation could you write<p><pre><code> defun sq(x) x*x </code></pre> or somehing along those lines?<p>would that then make it very hard to do macros and do write programs that write programs?

2 comments

jclalmost 17 years ago
Unless I'm missing something, M-expressions as expressed in the Wikipedia article are an alternate syntax for S-expressions; all the examples therein have the same number of parentheses/brackets in either syntax, so I don't think those M-expressions will save you many parentheses.<p>That said, you really only need parentheses (or other grouping operators) in situations where you don't know how many arguments there are; in most function calls, for instance, you know exactly how many parameters are needed, so the parentheses can be eliminated. This is effectively how Logo and Forth work.<p>However, eliminating parentheses in this manner means that the syntax tree interpretation of any given code depends on the function definitions currently in memory -- which is not the case with Lisp code, whose structure is explicit. I assume this would complicate a macro system.
pixpopalmost 17 years ago
Why do you think of parentheses as something about LISP that needs to be fixed? What exactly is the problem?
评论 #196809 未加载