comparison src/luan/modules/PackageLuan.java @ 1283:503bde9a7c80

add luan.require() and table.call()
author Franklin Schmidt <fschmidt@gmail.com>
date Fri, 21 Dec 2018 09:12:09 -0700
parents 781ec0a92bb5
children 2c8d1d76a82a
comparison
equal deleted inserted replaced
1282:2531942abaf3 1283:503bde9a7c80
85 } 85 }
86 return mod; 86 return mod;
87 } 87 }
88 88
89 static String read(LuanState luan,String uri) throws LuanException { 89 static String read(LuanState luan,String uri) throws LuanException {
90 LuanTable boot = (LuanTable)PackageLuan.require(luan,"luan:Boot.luan"); 90 LuanTable boot = (LuanTable)luan.require("luan:Boot.luan");
91 LuanFunction read = (LuanFunction)boot.get("read"); 91 return (String)Luan.first(boot.call("read",uri));
92 return (String)Luan.first(read.call(luan,new Object[]{uri}));
93 } 92 }
94 93
95 public static void enableLoad(LuanState luan,String... mods) throws LuanException { 94 public static void enableLoad(LuanState luan,String... mods) throws LuanException {
96 if( !luan.isLocked ) 95 if( !luan.isLocked )
97 return; 96 return;