From elliottslaughter at gmail.com Mon May 26 08:24:16 2008 From: elliottslaughter at gmail.com (Elliott Slaughter) Date: Mon, 26 May 2008 01:24:16 -0700 Subject: [cl-quasi-quote-devel] Help Getting Started with Quasiquote Message-ID: <42c0ab790805260124l4df23785mc57c731c6cc0be45@mail.gmail.com> Hi, I am attempting to write a macro which implicitly backquotes its arguments. After asking around a bit, I was directed to cl-quasi-quote as a possible solution to my problem. I have installed cl-quasi-quote, but am having a little trouble figuring out how to use the library, since all the examples seem to involve transforming a Lisp to some other language, which isn't really what I want to do. So my question is, how would you use cl-quasi-quote to write just a basic macro wrapping an expression in a quasi-quote? (Its a trivial example, but if I can figure this one out I should be able to do what I want in my project.) Thanks. -- Elliott Slaughter "Any road followed precisely to its end leads precisely nowhere." - Frank Herbert From elliottslaughter at gmail.com Mon May 26 08:25:56 2008 From: elliottslaughter at gmail.com (Elliott Slaughter) Date: Mon, 26 May 2008 01:25:56 -0700 Subject: [cl-quasi-quote-devel] Help Getting Started with Quasiquote Message-ID: <42c0ab790805260125s215958ecv572e0a967a36090e@mail.gmail.com> Hi, I am attempting to write a macro which implicitly backquotes its arguments. After asking around a bit, I was directed to cl-quasi-quote as a possible solution to my problem. I have installed cl-quasi-quote, but am having a little trouble figuring out how to use the library, since all the examples seem to involve transforming a Lisp to some other language, which isn't really what I want to do. So my question is, how would you use cl-quasi-quote to write just a basic macro wrapping an expression in a quasi-quote? (Its a trivial example, but if I can figure this one out I should be able to do what I want in my project.) Thanks. -- Elliott Slaughter "Any road followed precisely to its end leads precisely nowhere." - Frank Herbert From attila.lendvai at gmail.com Mon May 26 09:05:32 2008 From: attila.lendvai at gmail.com (Attila Lendvai) Date: Mon, 26 May 2008 11:05:32 +0200 Subject: [cl-quasi-quote-devel] Help Getting Started with Quasiquote In-Reply-To: <42c0ab790805260124l4df23785mc57c731c6cc0be45@mail.gmail.com> References: <42c0ab790805260124l4df23785mc57c731c6cc0be45@mail.gmail.com> Message-ID: > I am attempting to write a macro which implicitly backquotes its > arguments. After asking around a bit, I was directed to cl-quasi-quote > as a possible solution to my problem. I have installed cl-quasi-quote, > but am having a little trouble figuring out how to use the library, > since all the examples seem to involve transforming a Lisp to some > other language, which isn't really what I want to do. So my question currently our goal is to transform some other languages to lisp. more precisely: to lisp forms that emit the other language when executed. the languages we need now: xml, js, and sql (but cl-rdbms already has a half-assed version, so it works for now) > is, how would you use cl-quasi-quote to write just a basic macro > wrapping an expression in a quasi-quote? (Its a trivial example, but > if I can figure this one out I should be able to do what I want in my > project.) i'm not sure what you want, but maybe you should take a look at alexandria:once-only or similar macros. posting an example would help, too. if you really need read-time stuff, then there's a lisp.lisp in cl-qq, which is (or better, should be) a simple lisp quasi quote as specified by the standard. but currently it's commented out because it's lagging behind the rest of the lib. (and i think it really never worked...) it will be revived eventually, but it's not priority for us, while we have numerous other priorities, so... patches are welcome meanwhile! :) happy hacking, -- attila From elliottslaughter at gmail.com Mon May 26 19:08:09 2008 From: elliottslaughter at gmail.com (Elliott Slaughter) Date: Mon, 26 May 2008 12:08:09 -0700 Subject: [cl-quasi-quote-devel] Help Getting Started with Quasiquote In-Reply-To: References: <42c0ab790805260124l4df23785mc57c731c6cc0be45@mail.gmail.com> Message-ID: <42c0ab790805261208n1c4c31c1p3f26316a82b7221f@mail.gmail.com> On Mon, May 26, 2008 at 2:05 AM, Attila Lendvai wrote: >> I am attempting to write a macro which implicitly backquotes its >> arguments. After asking around a bit, I was directed to cl-quasi-quote >> as a possible solution to my problem. I have installed cl-quasi-quote, >> but am having a little trouble figuring out how to use the library, >> since all the examples seem to involve transforming a Lisp to some >> other language, which isn't really what I want to do. So my question > > currently our goal is to transform some other languages to lisp. more > precisely: to lisp forms that emit the other language when executed. > the languages we need now: xml, js, and sql (but cl-rdbms already has > a half-assed version, so it works for now) Ok, that's what I thought from looking at the your project page, but the name made me think perhaps you had a portable implementation of backquote. >> is, how would you use cl-quasi-quote to write just a basic macro >> wrapping an expression in a quasi-quote? (Its a trivial example, but >> if I can figure this one out I should be able to do what I want in my >> project.) > > > i'm not sure what you want, but maybe you should take a look at > alexandria:once-only or similar macros. posting an example would help, > too. I am trying to something along the lines of the following, which works unportably on CLISP. [1]> (defvar x 'a) X [2]> (defmacro wrap (expr) (list 'system::backquote expr)) WRAP [2]> (wrap x) X [4]> (wrap (system::unquote x)) A Except I'd also like to do [6]> (wrap ,x) which currently fails on CLISP because of read-time checks (the backquote doesn't appear in the form until macro-expansion time, which isn't early enough to make the reader happy). > if you really need read-time stuff, then there's a lisp.lisp in cl-qq, > which is (or better, should be) a simple lisp quasi quote as specified > by the standard. but currently it's commented out because it's lagging > behind the rest of the lib. (and i think it really never worked...) Perhaps... > it will be revived eventually, but it's not priority for us, while we > have numerous other priorities, so... patches are welcome meanwhile! > :) I don't know if I can provide patches; I've already been sidetracked once this project :) Thanks. -- Elliott Slaughter "Any road followed precisely to its end leads precisely nowhere." - Frank Herbert