I believe the quasiquoting that Joel is asking about is different from
make/bake. From the referenced paper
(http://www.eecs.harvard.edu/~mainland/ghc-quasiquoting/mainland07quasiquoting.pdf):

"Quasiquoting allows programmers to use domain specific syntax to
construct program fragments."

The examples show using a DSL to produce an abstract syntax tree,
instead of constructing that tree manually. For example, in my blog
posting here:

http://www.bluishcoder.co.nz/2006/10/compilers-and-interpreters-in-factor.html

I construct an abstract syntax tree with this code:

  5 <lit> <inc> <inc> <isz>
    6 <lit>
    7 <lit>
  <iff>
  42 <lit> 8 <lit> 9 <lit> <pair> <pair> <snd> <fst> <pair>

Much nicer would be to use a DSL that produces this AST from within
factor itself. This is possible with parsing words. And the default
tuple parsing words in the above case is fine.

To answer Joel's question, yes you can do what they do from Factor.
cpu.8080 does similar to convert an instruction set DSL to factor
quotations (which is the AST in this caes). peg.ebnf also takes this
approach to allow embedding a DSL which is converted to a tree of
objects describing the grammar.

Chris.
-- 
http://www.bluishcoder.co.nz

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Factor-talk mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to