Re: My thoughts on C# and gaming.
OvermindDL1 <[email protected]>
| Newsgroups | gmane.games.devel.sweng |
|---|---|
| Message-ID | <[email protected]> |
On Wed, Jan 27, 2010 at 9:18 PM, Bill Kelly <[email protected]> wrote: > OvermindDL1 wrote: >> I guess I should describe read-macro's quickly to explain how that >> works. A read-macro in Lisp looks for a token string (usually >> starting with #) where an open parenthesis usually can usually appear. >> As I recall, most LISP implementations (any that follow the standard) >> match the first two characters after that, but you can match further >> more inside your read-macro. At that point your read-macro is passed >> the character stream directly, and you match things and build a Lisp >> structure based on the stream input (in other words you build a >> parser). When you reach the end of the part of the stream that you >> want to parse then you just return the Lisp structure you built, and >> it compiles that structure as code in-place, and parsing happens >> through normal Lisp after that as normal. > > Intriguing! Thanks! > > > Found a detailed chapter on Lisp read-macros for those interested: > > http://letoverlambda.com/index.cl/guest/chap4.html Hmm, never seen that link before, thanks. Hah! I love this paragraph: >>> If all we have to do to parse these non-lisp domain specific languages is write a short read macro, maybe these non-lisp languages really are lisp, just in a clever disguise. If XML can be directly read in by the lisp reader, maybe XML, in a twisted sort of sense, is actually lisp. Similarly, read macros can be used to read regular expressions and SQL queries directly into lisp, so maybe these languages really are lisp too. This fuzzy distinction between code and data, lisp and non-lisp, is the source of many interesting philosophical issues that have perplexed lisp programmers since the very beginning. <<< That is *so* true, further proof that as any language evolves, they evolve to become LISP. ;-) Lisp really is the language that can do anything. Although I still prefer C++, I grew up with it... _______________________________________________ Sweng-Gamedev mailing list [email protected] http://lists.midnightryder.com/listinfo.cgi/sweng-gamedev-midnightryder.com