Re: Compiler.Control.quotation

Matthias Blume <[email protected]>
Newsgroups gmane.comp.lang.sml.smlnj
Message-ID <[email protected]>
Hi Dave,

the immediate problem you are seeing is due to the fact
that structure Control is now a toplevel structure and
no longer part of structure Compiler.

So changing "open Compiler.Control" into "open Control" should
fix the error.

However, there now is a more convenient way of achieving the same
effect.  You can temporarily (on a per-sourcfile basis) set any
control for which there is a command-line equivalent.  (Try running
sml as "sml -H" to get a full list.)

Here is what it looks like for the case of quotations.
In your .cm file, say

       foo.sml (with:parser.quotations=true)

or even more simply

       foo.sml (with:parser.quotations)

Kind regards,
Matthias


On Nov 9, 2006, at 9:35 AM, Dave Herman wrote:

> (Sorry for all the newbie questions lately.)
>
> I'm trying to use quasiquotation in a library and I can't figure  
> out the
> magic CM incantations. I found some hints in the CM manual which  
> led me
> to try the following:
>
>      Library
>              structure Foo
>      is
>              foo.sml (setup:(pre: "local open Compiler.Control\n\
>                                   \   in val q = !quotation before\n\
>                                   \              quotation := true\n\
>                                   \   end;"
>                              post:"Compiler.Control.quotation := q;"))
>              $/basis.cm
>              $/smlnj-lib.cm
>              $smlnj/compiler/compiler.cm
>              $mlrisc-tools/parser.cm
>              $mlrisc-tools/pp.cm
>              $mlrisc-tools/sml-ast.cm
>
> But I get "Error: unbound structure: Control in path  
> Compiler.Control".
>
> It seems the Visible Compiler isn't loaded by default. At the REPL, I
> can load it via CM.autoload "$smlnj/compiler/compiler.cm" and
> quasiquotation works, but from a CM library, the above didn't do  
> the trick.
>
> BTW, the config/preloads file suggests that the Compiler structure is
> the "old style" visible compiler, but I can't find any  
> documentation on
> the "new style." Is there a better way for me to be using  
> antiquotation?
>
> Thanks,
> Dave
>
> ---------------------------------------------------------------------- 
> ---
> Using Tomcat but need to do more? Need to support web services,  
> security?
> Get stuff done quickly with pre-integrated technology to make your  
> job easier
> Download IBM WebSphere Application Server v.1.0.1 based on Apache  
> Geronimo
> http://sel.as-us.falkag.net/sel? 
> cmd=lnk&kid=120709&bid=263057&dat=121642
> _______________________________________________
> Smlnj-list mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/smlnj-list
>


-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.