From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: "Pascal J. Bourguignon" Newsgroups: gmane.emacs.help Subject: Re: How the backquote and the comma really work? Date: Sun, 23 Aug 2015 18:46:07 +0200 Organization: Informatimago Message-ID: <87bndy6jhs.fsf@kuiper.lan.informatimago.com> References: <87vbebg1fs.fsf@mbork.pl> <87r3ozy9pf.fsf@web.de> <87si9ffys0.fsf@mbork.pl> <87d20jbqbj.fsf@web.de> <87pp4jfx9y.fsf@mbork.pl> <87615sxn1a.fsf@mbork.pl> <87zj318j7z.fsf@web.de> <87mvz1b16h.fsf@mbork.pl> <87k2u5azfi.fsf@mbork.pl> <87615mbo3z.fsf@mbork.pl> <877fptnoyu.fsf@web.de> <87k2tpyajy.fsf@web.de> <87h9o6gihr.fsf@mbork.pl> <878u9geaf7.fsf@kuiper.lan.informatimago.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: ger.gmane.org 1440348632 8640 80.91.229.3 (23 Aug 2015 16:50:32 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 23 Aug 2015 16:50:32 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Aug 23 18:50:23 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZTYTN-0007Sk-LM for geh-help-gnu-emacs@m.gmane.org; Sun, 23 Aug 2015 18:50:21 +0200 Original-Received: from localhost ([::1]:48547 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZTYTM-0000jd-Sb for geh-help-gnu-emacs@m.gmane.org; Sun, 23 Aug 2015 12:50:20 -0400 Original-Path: usenet.stanford.edu!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 50 Original-X-Trace: individual.net 70nSWcGlrIPsqZ6Wxk3FQQPGomfuI7c88b59HG1pyNC50ewnSa Cancel-Lock: sha1:Y2ExNWVmNmY5N2UzZTIxOWM1MTg4NzA1Yjk3OTA4YTdhMWM5NTA2Mg== sha1:KTjxv+1p9UVwVkRMLCmNl2EGHOY= Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwAQMAAABtzGvEAAAABlBMVEUAAAD///+l2Z/dAAAA oElEQVR4nK3OsRHCMAwF0O8YQufUNIQRGIAja9CxSA55AxZgFO4coMgYrEDDQZWPIlNAjwq9 033pbOBPtbXuB6PKNBn5gZkhGa86Z4x2wE67O+06WxGD/HCOGR0deY3f9Ijwwt7rNGNf6Oac l/GuZTF1wFGKiYYHKSFAkjIo1b6sCYS1sVmFhhhahKQssRjRT90ITWUk6vvK3RsPGs+M1RuR mV+hO/VvFAAAAABJRU5ErkJggg== X-Accept-Language: fr, es, en User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) Original-Xref: usenet.stanford.edu gnu.emacs.help:214496 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:106779 Archived-At: Marcin Borkowski writes: > On 2015-08-12, at 18:30, Pascal J. Bourguignon wrote: > >> Michael Heerdegen writes: >> >>> Marcin Borkowski writes: >>> >>>> Interestingly, there's a lot of buzz about Lisp /interpreter/ written >>>> in Lisp, but not so much about Lisp /reader/ written in Lisp. In >>>> fact, I didn't find one on the Internet. >> >> Not looking good enough. >> >> https://gitlab.com/com-informatimago/com-informatimago/tree/master/common-lisp/lisp-reader > > Thanks! > >> and of course, there's one in each lisp implementation. > > But often in C or something, not in Lisp. Nope. Only clisp and ecl have a lisp reader written in C. All the other implementations have it in lisp (or perhaps java). > And most probably I'll end up coding an abstraction like this, with > a function for looking at the next token without “consuming” it, and > a function for “popping” the next token. Converting between buffers and > streams wouldn’t be very useful for me, since I would either lose the > whole text structure (line-breaks, comments), or have to do a lot of > work to actually preserve it. Not necessarily. Just add the required information to your token structure, and you can also intersperse pseudo tokens for line-breaks and comments, (but this renders the grammar more hairy, since you have to allow for them between any other token; instead, you can just filter them out before the actual parsing). > OTOH, here I walk an Emacs buffer and not an external file. Moreover, > as I said, I don’t want to lose info on where I am in the source. In this case, you already have the whole source in memory… -- __Pascal Bourguignon__ http://www.informatimago.com/ “The factory of the future will have only two employees, a man and a dog. The man will be there to feed the dog. The dog will be there to keep the man from touching the equipment.” -- Carl Bass CEO Autodesk