Ejemplo n.º 1
0
 public ExecutableLoader(Stream s, string[] args)
 {
     using (var r = new StreamReader(s))
     {
         Cons cmdline = Cons.FromList(args);
         RuntimeExtensions.Eval("(apply load-port {0} {1})", r, cmdline);
     }
 }
Ejemplo n.º 2
0
 public void FromArrayTest()
 {
     string[] actual1 = new string[] { "a", "b", "c", "d", "e", "f", "g" };
     string[] actual2 = new string[] { "a", "b", "c", "d", "e", "f", "G" };
     string[] actual3 = new string[] { "A", "b", "c", "d", "e", "f", "G" };
     Assert.AreEqual <Cons>(_expected, Cons.FromList(actual1));
     Assert.AreNotEqual <Cons>(_expected, Cons.FromList(actual2));
     Assert.AreNotEqual <Cons>(_expected, Cons.FromList(actual3));
 }
Ejemplo n.º 3
0
        public override Expression Generate(object args, CodeBlock cb)
        {
            var  to = Builtins.First(args);
            Type t  = ExtractTypeInfo(to);

            if (t == null)
            {
                ClrSyntaxError("clr-type-of", "type not found", to, Cons.FromList(namespaces.Keys));
            }
            return(Ast.Constant(t));
        }
Ejemplo n.º 4
0
        public void FromListTest()
        {
            List <string> actual1 = new List <string>()
            {
                "a", "b", "c", "d", "e", "f", "g"
            };
            List <string> actual2 = new List <string>()
            {
                "a", "b", "c", "d", "e", "f", "G"
            };
            List <string> actual3 = new List <string>()
            {
                "A", "b", "c", "d", "e", "f", "G"
            };

            Assert.AreEqual <Cons>(_expected, Cons.FromList(actual1));
            Assert.AreNotEqual <Cons>(_expected, Cons.FromList(actual2));
            Assert.AreNotEqual <Cons>(_expected, Cons.FromList(actual3));
        }
Ejemplo n.º 5
0
 public override Expression Generate(object args, CodeBlock cb)
 {
     return(Ast.Constant(new IronSchemeConstant(Cons.FromList(namespaces.Keys), cb)));
 }