Friendlier syntax
- From: Khookie <chris.khoo@xxxxxxxxx>
- Date: Wed, 18 Jul 2007 16:47:25 -0700
Hi everyone
Just had an idea this morning - don't know how good it is tho since
I'm very new to Lisp. Would like to get some feedback:-
So for the context:
I don't know about you, but I think Python's use of whitespace makes
code very pleasing to look at. I'm guessing this is partially why
it's gotten so popular.
Now the idea I'm proposing: I was thinking about this in regards to
Lisp, and I thought, why can't it be represented like that as well?
Example:
test 2
blah 2 3
asdf 3 4 (test 156)
setq blah 3
bleh 15
....
can be translated to sexprs based on whitespace:
(test 2 (blah 2 3) (asdf 3 4 (test 156)) (setq blah 3)) (bleh 15)
* For every new line, prefix with a ( to create a sexpr.From a parsing perspective:
* If next line has the same level indent, close off sexpr with a ).
* If next line is indented, don't do anything.
* If next line is outdented, add a ), and for each level it is
outdented, add a ).
Interesting Points
* You can still use parentheses, but they've to be on the same line.
* I'm not sure about things like quoting & backquoting sexprs, macros,
etc. But I imagine all potential problems are solvable, if there are
any.
What does everyone think?
.
- Follow-Ups:
- Re: Friendlier syntax
- From: Chris Khoo
- Re: Friendlier syntax
- From: Steve
- Re: Friendlier syntax
- From: jimbokun
- Re: Friendlier syntax
- From: Förster vom Silberwald
- Re: Friendlier syntax
- From: Slobodan Blazeski
- Re: Friendlier syntax
- From: Chris Russell
- Re: Friendlier syntax
- From: Michael Bohn
- Re: Friendlier syntax
- From: Matthias Buelow
- Re: Friendlier syntax
- From: Jon Harrop
- Re: Friendlier syntax
- From: Pascal Bourguignon
- Re: Friendlier syntax
- From: Ken Tilton
- Re: Friendlier syntax
- From: Stefan Scholl
- Re: Friendlier syntax
- From: Kjetil S. Matheussen
- Re: Friendlier syntax
- Prev by Date: Re: Book recommendation : Software Craftsmanship: The New Imperative
- Next by Date: Re: Implement the Gabriel benchmarks in OCaml
- Previous by thread: Lisp Question
- Next by thread: Re: Friendlier syntax
- Index(es):
Relevant Pages
|