@@ -27,16 +27,14 @@ public DataObject load(List<DataObject> args, final int SCOPE_ID) {
27
27
28
28
//Calling a predefined function
29
29
DataObject funcPrintln = getPredefinedFunctionAsDataObject ("println" );
30
-
31
- List <DataObject > funcPrintlnArgs = new ArrayList <>();
32
- funcPrintlnArgs .add (new DataObject ("Hello world! From this module!" ));
33
-
34
- callFunctionPointer (funcPrintln , funcPrintlnArgs , SCOPE_ID );
30
+ callFunctionPointer (funcPrintln , Arrays .asList (
31
+ new DataObject ("Hello world! From this module!" )
32
+ ), SCOPE_ID );
35
33
36
34
//Calling a predefined function (Alternate way)
37
- List < DataObject > funcPrintlnArgs2 = new ArrayList <>();
38
- funcPrintlnArgs2 . add ( new DataObject ("Another print statement." ));
39
- callPredefinedFunction ( "println" , funcPrintlnArgs2 , SCOPE_ID );
35
+ callPredefinedFunction ( "println" , Arrays . asList (
36
+ new DataObject ("Another print statement." )
37
+ ) , SCOPE_ID );
40
38
41
39
exportFunction ("exampleFunction" , (argumentList , INNER_SCOPE_ID ) -> {
42
40
List <DataObject > innerCombinedArgs = LangUtils .combineArgumentsWithoutArgumentSeparators (argumentList );
@@ -83,14 +81,12 @@ public DataObject load(List<DataObject> args, final int SCOPE_ID) {
83
81
return new DataObject ().setInt (-42 );
84
82
})));
85
83
86
- DataObject linkerInclude = getPredefinedFunctionAsDataObject ("include" );
87
-
88
- List <DataObject > linkerIncludeArgs = new ArrayList <>();
89
- linkerIncludeArgs .add (new DataObject ("lib.lang" ));
90
- linkerIncludeArgs .add (new DataObject ("Argument1 from ExampleModule" ));
91
- linkerIncludeArgs = LangUtils .separateArgumentsWithArgumentSeparators (linkerIncludeArgs );
92
-
93
- DataObject ret = callFunctionPointer (linkerInclude , linkerIncludeArgs , SCOPE_ID );
84
+ DataObject ret = callPredefinedFunction ("include" , LangUtils .separateArgumentsWithArgumentSeparators (
85
+ Arrays .asList (
86
+ new DataObject ("lib.lang" ),
87
+ new DataObject ("Argument1 from ExampleModule" )
88
+ )
89
+ ), SCOPE_ID );
94
90
95
91
//Accessing exported module variables within the module (The module name must be used [Use lmc.getName()])
96
92
Map <String , DataObject > exportedVars = lii .getModuleExportedVariables (lmc .getName ());
0 commit comments