tag:blogger.com,1999:blog-5722310642266356003.post5896612685624042687..comments2024-01-07T23:21:32.676+01:00Comments on The Axis of Eval: A quasiquote I can understandUnknownnoreply@blogger.comBlogger8125tag:blogger.com,1999:blog-5722310642266356003.post-70330841708361599562013-09-09T13:26:47.017+02:002013-09-09T13:26:47.017+02:00I've been re-implementing my quasiquote for R ...I've been re-implementing my quasiquote for R as a memoizing macro style for speed concerns.<br /><br />Implementing quasiquote as an fexpr was easy peasy, just take your parse tree and march over it stuffing in new eval results. The macro style where you build an expression that evals to the actual thing you want is making me go crosseyed.<br /><br />(R is one of those languages that is perfectly horrible with an awful library except it has one or two accidentally good ideas. it's the most widely used language built on first class environments + fexpr equivalents + almost lexical scope, for instance, but no one writing it knows how to do hygeine.)crowdingnoreply@blogger.comtag:blogger.com,1999:blog-5722310642266356003.post-67208008857059794102013-05-18T04:13:35.472+02:002013-05-18T04:13:35.472+02:00> (from http://norstrulde.org/ilge10/)
As the ...> (from http://norstrulde.org/ilge10/)<br /><br />As the author of that page, I can say that that version, in turn, is a de-optimized variant of what is printed in Peter Norvig's Paradigms of Artificial Intelligence Programming. (I didn't try to save memory by sharing structure.)<br /><br />And Norvig, in turn, credits Artificial Intelligence Programming by Charniak et al. :)Erichttp://norstrulde.orgnoreply@blogger.comtag:blogger.com,1999:blog-5722310642266356003.post-36397778629853216132013-05-02T10:49:01.031+02:002013-05-02T10:49:01.031+02:00Same here. I did it multiple times and I still fi...Same here. I did it multiple times and I still find it extremely mind-bending. Long ago I used to think it's a reader thing, but nope, the quasiquotation happens at run time (hence, it's pointless to try to implement it in JS or whatever is the host language, it has to be implemented in Lisp).<br /><br />I found a small and elegant implementation: https://github.com/mishoo/SLip/blob/master/lisp/compiler.lisp#L25<br /><br />(from http://norstrulde.org/ilge10/)Unknownhttps://www.blogger.com/profile/07723850956802550453noreply@blogger.comtag:blogger.com,1999:blog-5722310642266356003.post-91881370060527260292013-04-30T03:37:24.209+02:002013-04-30T03:37:24.209+02:00You really should look at Clojure, that is exactly...You really should look at Clojure, that is exactly what it does.Ferdinand Svehlahttps://www.blogger.com/profile/02767731644295181114noreply@blogger.comtag:blogger.com,1999:blog-5722310642266356003.post-56831287601383663432013-04-29T22:17:02.374+02:002013-04-29T22:17:02.374+02:00Congratulations. You've again hit on the very...Congratulations. You've again hit on the very thing that Clojure does. When will you be switching to Clojure again? ;-) Just kidding of course.fogushttp://www.fogus.menoreply@blogger.comtag:blogger.com,1999:blog-5722310642266356003.post-54527236065875723582013-04-29T13:40:56.234+02:002013-04-29T13:40:56.234+02:00You didn't cover how to match unquotes with qu...You didn't cover how to match unquotes with quasiquotes, since nested quasiquotes can get confusing too.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-5722310642266356003.post-28155555732318668322013-04-28T20:44:22.909+02:002013-04-28T20:44:22.909+02:00This is the usual way. Guy Steele's implementa...This is the usual way. <a href="http://lib.store.yahoo.net/lib/paulgraham/glsbq.lisp" rel="nofollow">Guy Steele's implementation from CLtL2</a>, for instance, uses APPEND but then complexly simplifies it away (in the interest of efficiency, even though that's seldom an issue for backquote). It would be difficult to make nested splicing work correctly otherwise. (Actually, I was hoping this post was about alternative semantics for nested backquotes, but I guess I'll have to write that myself.)Arcane Sentimenthttps://www.blogger.com/profile/04144052171693893368noreply@blogger.comtag:blogger.com,1999:blog-5722310642266356003.post-46834916364097426592013-04-28T20:11:31.814+02:002013-04-28T20:11:31.814+02:00This is the approach of the expansion algorithm in...This is the approach of the expansion algorithm in Alan Bawden's Quasiquotation in Lisp (http://repository.readscheme.org/ftp/papers/pepm99/bawden.pdf).Orivej Deshhttps://github.com/orivejnoreply@blogger.com