annotate tests/caseMod.ur @ 1739:c414850f206f

Add support for -boot flag, which allows in-tree execution of Ur/Web The boot flag rewrites most hardcoded paths to point to the build directory, and also forces static compilation. This is convenient for developing Ur/Web, or if you cannot 'sudo make install' Ur/Web. The following changes were made: * Header files were moved to include/urweb instead of include; this lets FFI users point their C_INCLUDE_PATH at this directory at write <urweb/urweb.h>. For internal Ur/Web executables, we simply pass -I$PATH/include/urweb as normal. * Differentiate between LIB and SRCLIB; SRCLIB is Ur and JavaScript source files, while LIB is compiled products from libtool. For in-tree compilation these live in different places. * No longer reference Config for paths; instead use Settings; these settings can be changed dynamically by Compiler.enableBoot () (TODO: add a disableBoot function.) * config.h is now generated directly in include/urweb/config.h, for consistency's sake (especially since it gets installed along with the rest of the headers!) * All of the autotools build products got updated. * The linkStatic field in protocols now only contains the name of the build product, and not the absolute path. Future users have to be careful not to reference the Settings files to early, lest they get an old version (this was the source of two bugs during development of this patch.)
author Edward Z. Yang <ezyang@mit.edu>
date Wed, 02 May 2012 17:17:57 -0400
parents 71bafe66dbe1
children
rev   line source
adamc@174 1 structure M = struct
adamc@174 2 datatype t = A | B
adamc@174 3 end
adamc@174 4
adamc@174 5 val f = fn x : M.t => case x of M.A => M.B | M.B => M.A
adamc@174 6
adamc@174 7 datatype t = datatype M.t
adamc@174 8
adamc@174 9 val g = fn x : t => case x of M.A => B | B => M.A
adamc@174 10
adamc@174 11 structure N = struct
adamc@177 12 datatype u = C of t | D
adamc@174 13 end
adamc@174 14
adamc@177 15 val h = fn x : N.u => case x of N.C x => x | N.D => M.A
adamc@174 16
adamc@177 17 datatype u = datatype N.u
adamc@174 18
adamc@174 19 val i = fn x : u => case x of N.C x => x | D => M.A
adamc@177 20
adamc@177 21 val toString = fn x =>
adamc@177 22 case x of
adamc@177 23 C A => "C A"
adamc@177 24 | C B => "C B"
adamc@177 25 | D => "D"
adamc@177 26
adamc@183 27 val rec page = fn x => <html><body>
adamc@183 28 {cdata (toString x)}<br/>
adamc@183 29 <br/>
adamc@183 30
adamc@183 31 <a link={page x}>Again!</a>
adamc@177 32 </body></html>
adamc@177 33
adamc@177 34 val main : unit -> page = fn () => <html><body>
adamc@177 35 <li> <a link={page (C A)}>C A</a></li>
adamc@177 36 <li> <a link={page (C B)}>C B</a></li>
adamc@177 37 <li> <a link={page D}>D</a></li>
adamc@177 38 </body></html>