@@ -24,13 +24,14 @@ public DataObject load(List<DataObject> args, final int SCOPE_ID) {
24
24
for (DataObject arg :combinedArgs )
25
25
System .out .println (" " + arg );
26
26
System .out .println ();
27
-
28
- LangPredefinedFunctionObject funcPrintln = lii .getPredefinedFunctions ().get ("println" );
27
+
28
+ //Calling a predefined function
29
+ DataObject funcPrintln = getPredefinedFunctionAsDataObject ("println" );
29
30
30
31
List <DataObject > funcPrintlnArgs = new ArrayList <>();
31
32
funcPrintlnArgs .add (new DataObject ("Hello world! From this module!" ));
32
33
33
- lii . callFunctionPointer (new FunctionPointerObject ( funcPrintln ), "println" , funcPrintlnArgs , SCOPE_ID );
34
+ callFunctionPointer (funcPrintln , funcPrintlnArgs , SCOPE_ID );
34
35
35
36
exportFunction ("exampleFunction" , (argumentList , INNER_SCOPE_ID ) -> {
36
37
List <DataObject > innerCombinedArgs = LangUtils .combineArgumentsWithoutArgumentSeparators (argumentList );
@@ -77,14 +78,14 @@ public DataObject load(List<DataObject> args, final int SCOPE_ID) {
77
78
return new DataObject ().setInt (-42 );
78
79
})));
79
80
80
- LangPredefinedFunctionObject linkerInclude = lii . getPredefinedFunctions (). get ("include" );
81
+ DataObject linkerInclude = getPredefinedFunctionAsDataObject ("include" );
81
82
82
83
List <DataObject > linkerIncludeArgs = new ArrayList <>();
83
84
linkerIncludeArgs .add (new DataObject ("lib.lang" ));
84
85
linkerIncludeArgs .add (new DataObject ("Argument1 from ExampleModule" ));
85
86
linkerIncludeArgs = LangUtils .separateArgumentsWithArgumentSeparators (linkerIncludeArgs );
86
87
87
- DataObject ret = lii . callFunctionPointer (new FunctionPointerObject ( linkerInclude ), "include" , linkerIncludeArgs , SCOPE_ID );
88
+ DataObject ret = callFunctionPointer (linkerInclude , linkerIncludeArgs , SCOPE_ID );
88
89
89
90
//Accessing exported module variables within the module (The module name must be used [Use lmc.getName()])
90
91
Map <String , DataObject > exportedVars = lii .getModuleExportedVariables (lmc .getName ());
0 commit comments