import org.simantics.scl.compiler.types.Type;
import org.simantics.scl.compiler.types.Types;
import org.simantics.scl.compiler.types.exceptions.MatchException;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
import gnu.trove.map.hash.THashMap;
public abstract class FunctionValue extends Constant {
+ private static final Logger LOGGER = LoggerFactory.getLogger(FunctionValue.class);
+
TVar[] typeParameters;
Type returnType;
protected Type[] parameterTypes;
public Type apply(MethodBuilder mb, Type[] typeParameters, Val... parameters) {
int arity = getArity();
- /*System.out.println("MONADIC APPLICATION " + this);
- System.out.println(" call arity: " + parameters.length);
- System.out.println(" func arity: " + arity);
- System.out.println(" func monadic: " + isMonadic());
+ /*LOGGER.info("MONADIC APPLICATION " + this);
+ LOGGER.info(" call arity: " + parameters.length);
+ LOGGER.info(" func arity: " + arity);
+ LOGGER.info(" func monadic: " + isMonadic());
*/
if(parameters.length < arity) {
ModuleBuilder moduleBuilder = mb.getModuleBuilder();
ClassBuilder classFile;
if(arity <= Constants.MAX_FUNCTION_PARAMETER_COUNT) {
if(SCLCompilerConfiguration.TRACE_METHOD_CREATION)
- System.out.println("Create class " + policy.getModuleClassName());
+ LOGGER.info("Create class " + policy.getModuleClassName());
classFile = new ClassBuilder(moduleBuilder, Opcodes.ACC_PUBLIC, policy.getModuleClassName(),
MethodBuilderBase.getClassName(Constants.FUNCTION_IMPL[arity]));
classFile.setSourceFile("_SCL_FunctionValue");
}
else {
if(SCLCompilerConfiguration.TRACE_METHOD_CREATION)
- System.out.println("Create class " + policy.getModuleClassName());
+ LOGGER.info("Create class " + policy.getModuleClassName());
classFile = new ClassBuilder(moduleBuilder, Opcodes.ACC_PUBLIC, policy.getModuleClassName(),
MethodBuilderBase.getClassName(Constants.FUNCTION_N_IMPL));
classFile.setSourceFile("_SCL_FunctionValue");
if(valueCache != null) {
valueCache.put(this, result);
if(TRACE_REALIZATION)
- System.out.println("/REALIZED/ " + this + " " + getClass().getSimpleName());
+ LOGGER.info("/REALIZED/ " + this + " " + getClass().getSimpleName());
}
return result;
} catch (InstantiationException e) {