import org.simantics.scl.compiler.constants.singletons.FailFunction;
import org.simantics.scl.compiler.constants.singletons.JustConstant;
import org.simantics.scl.compiler.constants.singletons.NothingConstant;
+import org.simantics.scl.compiler.constants.singletons.ThrowFunction;
import org.simantics.scl.compiler.constants.singletons.TypeOfConstant;
import org.simantics.scl.compiler.constants.singletons.TypeOfProxyConstant;
import org.simantics.scl.compiler.constants.singletons.TypeProxyConstant;
addTypeDescriptor("Variant", new StandardTypeConstructor(Types.VARIANT, Kinds.STAR, TypeDesc.forClass(Variant.class)));
addEffectConstructor("Proc", new EffectConstructor(Types.PROC));
+ addEffectConstructor("Exception", new EffectConstructor(Types.EXCEPTION));
//addTypeDescriptor("->", new StandardTypeConstructor(Kinds.STAR_TO_STAR_TO_STAR, Constants.FUNCTION));
addTypeDescriptor("[]", new StandardTypeConstructor(Types.LIST, Kinds.STAR_TO_STAR, Constants.LIST));
new Constructor(Locations.NO_LOCATION, MaybeType.INSTANCE, Just.getName(), new Type[] {MaybeType.INSTANCE.parameters[0]}, null)
);
+ // *** Dynamic ***
+
+ addValue("Dynamic", DynamicConstructor.INSTANCE);
+
// *** Vector ***
TypeClass VecCompC = new TypeClass(Locations.NO_LOCATION,
addValue("fail", FailFunction.INSTANCE).documentation =
"Throws a runtime exeception with the given string as a description.";
+ addValue("throw", ThrowFunction.INSTANCE).documentation =
+ "Throws a given exception.";
// *** runProc ***
"union",
Types.NO_EFFECTS,
Type, Type, Type));
-
+ addValue("TUnion3", new JavaStaticMethod(
+ "org/simantics/scl/compiler/types/Types",
+ "union",
+ Types.NO_EFFECTS,
+ Type, Type, Type, Type));
+
StandardTypeConstructor TypeC = new StandardTypeConstructor(Type, Kinds.STAR,
TypeDesc.forClass("org/simantics/scl/compiler/types/Type"));
TypeC.setType(Type);