view tests/stuff.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
line wrap: on
line source
type c1 = t :: Type -> t
con c2 :: Type = t :: Type -> t
con c3 = fn t :: Type => c1
con c4 = c3 c1
con c5 = (fn t :: Type => c1) c1

con name = #MyName

con c6 = {A : c1, name : c2}
con c7 = [A = c1, name = c2]

con c8 = fn t :: Type => t

con c9 = {}
con c10 = ([]) :: {Type}

val v1 = fn t :: Type => fn x : t => x
val v2 = v1 [t :: Type -> t -> t] v1

val r = {X = v1, Y = v2}
val v1_again = r.X
val v2_again = r.Y

val r2 = {X = {}, Y = v2, Z = {}}
val r2_X = r2.X
val r2_Y = r2.Y
val r2_Z = r2.Z

val f = fn fs :: {Type} => fn x : $([X = {}] ++ fs) => x.X
val f2 = fn fs :: {Type} => fn x : $(fs ++ [X = {}]) => x.X
val f3 = fn fs :: {Type} => fn x : $([X = {}, Y = {Z : {}}] ++ fs) => x.X
val f4 = fn fs :: {Type} => fn x : $([X = {}, Y = {Z : {}}] ++ fs) => x.Y
val f5 = fn fs1 :: {Type} => fn fs2 :: {Type} => fn x : $(fs1 ++ [X = {}] ++ fs2) => x.X
val f6 = fn fs1 :: {Type} => fn fs2 :: {Type} => fn x : $(fs1 ++ [X = {}] ++ fs2 ++ [Y = {Z : {}}]) => x.X
val f7 = fn fs1 :: {Type} => fn fs2 :: {Type} => fn x : $(fs1 ++ [X = {}] ++ fs2 ++ [Y = {Z : {}}]) => x.Y

val test = f [[Y = t :: Type -> t -> t, Z = {}]] r2
val test = f7 [[Y = t :: Type -> t -> t]] [[Z = {}]] r2