@Signature @FastMethod public static Memory pathSeparator(Environment env, Memory... args) { return StringMemory.valueOf(File.pathSeparator); }
@Signature @FastMethod public static Memory separator(Environment env, Memory... args) { return StringMemory.valueOf(File.separator); }
@FastMethod @Signature({ @Arg("funcName") }) public static Memory functionModule(Environment env, Memory... args) { FunctionEntity entity = env.fetchFunction(args[0].toString()); if (entity != null && entity.getModule() != null) { return ObjectMemory.valueOf(new WrapModule(env, entity.getModule())); } return Memory.NULL; }
@FastMethod @Signature({ @Arg("object"), @Arg(value = "toLower", optional = @Optional("false")) }) public static Memory typeOf(Environment env, Memory... args) { if (args[0].isObject()) { ClassEntity entity = args[0].toValue(ObjectMemory.class).getReflection(); return StringMemory.valueOf(args[1].toBoolean() ? entity.getLowerName() : entity.getName()); } else { return Memory.FALSE; } }
@Runtime.FastMethod @Signature({ @Arg("callback") }) public static Memory of(Environment env, Memory... args) { Invoker invoker = Invoker.valueOf(env, null, args[0]); if (invoker == null) return Memory.NULL; return new ObjectMemory(new WrapInvoker(env, invoker)); } }
@FastMethod @Signature({ @Arg("typeName") }) public static Memory typeModule(Environment env, Memory... args) { ClassEntity classEntity = env.fetchClass(args[0].toString(), true); if (classEntity != null && classEntity.getModule() != null) { return ObjectMemory.valueOf(new WrapModule(env, classEntity.getModule())); } return Memory.NULL; }