Example #1
0
        static Environment()
        {
            Runtime.Import(typeof(Environment).Assembly);
            string fp = System.IO.Path.GetDirectoryName(typeof(Environment).Assembly.Location)
                        + System.IO.Path.DirectorySeparatorChar + "lsc.exe";

            if (System.IO.File.Exists(fp))
            {
                Assembly a = AssemblyCache.LoadAssembly(fp);
                Runtime.Import(a);
            }
        }
Example #2
0
        public static object Import(string assembly, Environment environment)
        {
            string   fn  = Path.GetFullPath(assembly);
            Assembly ass = AssemblyCache.LoadAssembly(fn);

            ass = Import(ass);
            if (ass != null)
            {
                environment.UpdateBindings();
                return(Path.GetFileName(fn));
            }
            else
            {
                return(null);
            }
        }
Example #3
0
        public static Object Reference(Cons args, Environment environment)
        {
            object result = null;

            foreach (object module in args)
            {
                if (module is string)
                {
                    result = AssemblyCache.LoadAssembly((string)module);
                }
                else
                {
                    throw new LSharpException(String.Format("Reference: {0} is not a string", module));
                }
            }
            return(result);
        }