From: jurgen_defurne on 26 Apr 2010 05:55 On Apr 19, 12:53 am, Alessio Stalla <alessiosta...(a)gmail.com> wrote: > I have coded some simple syntax sugar to provide a vaguely "C-like" > syntax for Lisp, part as a proof of concept, part with the intention > of actually using it in a library. It's not meant to replace sexps but > just to be less scary for newbies AND to show that the syntax argument > against Lisp is just dumb. I'd never use it myself of course ;) > > The syntax is based on the Lisp reader, with these simple rules: > > , (comma) is considered whitespace. > expressions are separated by ; > ( ) still delimit lists. > expressions consisting of multiple tokens are automatically wrapped in > a list. Expressions consisting of a single token are not listified, so > foo is read as a symbol while (foo) as a list. > foo { ... } is roughly like `(foo ,@(list ...)) i.e. the expressions > inside the braces are inserted in the outer expression. > > That's pretty much all, and it turns out - surprisingly - to cover > many common expressions you can find in Lisp. Plus, reader macros > still work (though of course they don't understand the "C-like" > syntax). > > An example: > > with-output-to-string (str) { > print #\c str; > if (> foo 45) { > progn { print 3; print 4; } > print 5; > } > > } > > If anyone's interested, the code is here:http://alessiostalla.altervista.org/software/c-like-lisp/cll.lisp > > it's far from perfect; for example, braces inside lists are read as > literal characters. But, as a quick hack it came out pretty good, > imho. > > Cheers, > Alessio I am doing the opposite : I am building a Lisp-like system programming language to program a system for which I built the ISA, simulator and assembler all in Common Lisp. Currently a little bit on hold due to a very busy job, but hoping I can continue with it soon. As someone who has programmed in Pascal, C, Clipper, FoxPro, COBOL (74 and 85), Perl, Scheme and Common Lisp, I think that Common Lisp offers enough opportunities to be programmed by anybody. I have programmed in C, but in the meantime I have come to really, really dislike its cryptic syntax, and prefer the simple cleanliness of Lisp (any Lisp). Regards, Jurgen |