Examples of newNativeMethod()


Examples of ioke.lang.Runtime.newNativeMethod()

        holder.currentCompletor = null;

        IokeObject history = runtime.newFromOrigin();
        rl.setCell("HISTORY", history);

        rl.registerMethod(runtime.newNativeMethod("will print a prompt to standard out and then try to read a line with working readline functionality. takes two arguments, the first is the string to prompt, the second is a boolean that says whether we should add the read string to history or not", new NativeMethod("readline") {
                private final DefaultArgumentsDefinition ARGUMENTS = DefaultArgumentsDefinition
                    .builder()
                    .withRequiredPositional("prompt")
                    .withRequiredPositional("addToHistory?")
                    .getArguments();
View Full Code Here

Examples of ioke.lang.Runtime.newNativeMethod()

                    }
                    return line;
                }
            }));

        history.registerMethod(runtime.newNativeMethod("will add a new line to the history", new NativeMethod("<<") {
                private final DefaultArgumentsDefinition ARGUMENTS = DefaultArgumentsDefinition
                    .builder()
                    .withRequiredPositional("line")
                    .getArguments();
View Full Code Here

Examples of ioke.lang.Runtime.newNativeMethod()

        Runtime runtime = bm.runtime;
        bm.setKind("Benchmark");
        runtime.ground.setCell("Benchmark", bm);
        bm.singleMimicsWithoutCheck(runtime.origin);

        bm.registerMethod(runtime.newNativeMethod("expects two optional numbers, x (default 10) and y (default 1), and a block of code to run, and will run benchmark this block x times, while looping y times in each benchmark. after each loop will print the timings for this loop", new NativeMethod("report") {
                private final DefaultArgumentsDefinition ARGUMENTS = DefaultArgumentsDefinition
                    .builder()
                    .withOptionalPositional("repetitions", "10")
                    .withOptionalPositional("loops", "1")
                    .withRequiredPositionalUnevaluated("code")
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.