]> gerrit.simantics Code Review - simantics/platform.git/blobdiff - bundles/org.simantics.scl.compiler/src/org/simantics/scl/compiler/elaboration/java/Builtins.java
HTTP/Client SCL module for HTTP requests
[simantics/platform.git] / bundles / org.simantics.scl.compiler / src / org / simantics / scl / compiler / elaboration / java / Builtins.java
index 631ef2ddc6d7ac874ca073c6b5c6b4363579a488..5004bc0556355e08e597073e4440dfa5e7761520 100644 (file)
@@ -15,6 +15,7 @@ import org.simantics.scl.compiler.constants.NoRepConstant;
 import org.simantics.scl.compiler.constants.SCLConstant;
 import org.simantics.scl.compiler.constants.SCLConstructor;
 import org.simantics.scl.compiler.constants.singletons.BindingConstant;
+import org.simantics.scl.compiler.constants.singletons.ClassConstant;
 import org.simantics.scl.compiler.constants.singletons.FailFunction;
 import org.simantics.scl.compiler.constants.singletons.JustConstant;
 import org.simantics.scl.compiler.constants.singletons.NothingConstant;
@@ -24,6 +25,7 @@ import org.simantics.scl.compiler.constants.singletons.TypeOfProxyConstant;
 import org.simantics.scl.compiler.constants.singletons.TypeProxyConstant;
 import org.simantics.scl.compiler.elaboration.fundeps.Fundep;
 import org.simantics.scl.compiler.elaboration.modules.Documentation;
+import org.simantics.scl.compiler.elaboration.modules.PrivateProperty;
 import org.simantics.scl.compiler.elaboration.modules.SCLValue;
 import org.simantics.scl.compiler.elaboration.modules.TypeClass;
 import org.simantics.scl.compiler.errors.Locations;
@@ -154,10 +156,12 @@ public class Builtins extends ConcreteModule {
         // *** Lists ***
         
         for(int arity=0;arity<=Constants.MAX_LIST_LITERAL_LENGTH;++arity) {
-            LIST_CONSTRUCTORS[arity] = addValue("_list_literal_" + arity + "_",
+            SCLValue value = addValue("_list_literal_" + arity + "_",
                     arity == 0 ? new EmptyListConstructor() : 
                         new ListConstructor(arity)
                     );
+            value.addProperty(PrivateProperty.INSTANCE);
+            LIST_CONSTRUCTORS[arity] = value;
         }
         
         // *** Boolean ***
@@ -206,6 +210,12 @@ public class Builtins extends ConcreteModule {
         addValue("freezeMVector", new FreezeMVector());
         addValue("setMVector", SetMVector.INSTANCE);       
         
+        StandardTypeConstructor ClassC = new StandardTypeConstructor(Types.CLASS, Kinds.STAR_TO_STAR, 
+                TypeDesc.forClass("java/lang/Class"));
+        ClassC.setType(Types.CLASS, A);
+        addTypeDescriptor("Class", ClassC);
+        addValue("classObject", ClassConstant.INSTANCE);
+        
         // *** fail ***
         
         addValue("fail", FailFunction.INSTANCE).documentation =
@@ -286,7 +296,12 @@ public class Builtins extends ConcreteModule {
                     "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);