Ejemplo n.º 1
0
        public Namespace AsNamespace()
        {
            var array_ns = new Shell.Types.Namespace(typeof(Array).Name);

            var pushfn = new Shell.Types.Function(typeof(Shell.Library.Functions.Array.Push).Name);

            pushfn.AddBuiltinLambda(new Shell.Library.Functions.Array.Push());
            array_ns.Set(pushfn.name, pushfn);

            var popfn = new Shell.Types.Function(typeof(Shell.Library.Functions.Array.Pop).Name);

            popfn.AddBuiltinLambda(new Shell.Library.Functions.Array.Pop());
            array_ns.Set(popfn.name, popfn);

            var insertfn = new Shell.Types.Function(typeof(Shell.Library.Functions.Array.Insert).Name);

            insertfn.AddBuiltinLambda(new Shell.Library.Functions.Array.Insert());
            array_ns.Set(insertfn.name, insertfn);

            var deletefn = new Shell.Types.Function(typeof(Shell.Library.Functions.Array.Delete).Name);

            deletefn.AddBuiltinLambda(new Shell.Library.Functions.Array.Delete());
            array_ns.Set(deletefn.name, deletefn);

            var rangefn = new Shell.Types.Function(typeof(Shell.Library.Functions.Array.Range).Name);

            rangefn.AddBuiltinLambda(new Shell.Library.Functions.Array.Range());
            array_ns.Set(rangefn.name, rangefn);

            return(array_ns);
        }
Ejemplo n.º 2
0
        public Namespace AsNamespace()
        {
            var string_ns = new Shell.Types.Namespace(typeof(String).Name);

            var lengthfn = new Shell.Types.Function(typeof(Shell.Library.Functions.String.Length).Name);

            lengthfn.AddBuiltinLambda(new Shell.Library.Functions.String.Length());
            string_ns.Set(lengthfn.name, lengthfn);

            var substrfn = new Shell.Types.Function(typeof(Shell.Library.Functions.String.Substring).Name);

            substrfn.AddBuiltinLambda(new Shell.Library.Functions.String.Substring());
            string_ns.Set(substrfn.name, substrfn);

            return(string_ns);
        }
Ejemplo n.º 3
0
        public Namespace AsNamespace()
        {
            var dir_ns = new Shell.Types.Namespace(typeof(Directory).Name);

            dir_ns.Set("Current", GetCWD());

            var changefn = new Shell.Types.Function(typeof(Shell.Library.Functions.Directory.Change).Name);

            changefn.AddBuiltinLambda(new Shell.Library.Functions.Directory.Change());
            dir_ns.Set(changefn.name, changefn);

            var listfn = new Shell.Types.Function(typeof(Shell.Library.Functions.Directory.List).Name);

            listfn.AddBuiltinLambda(new Shell.Library.Functions.Directory.List());
            listfn.AddBuiltinLambda(new Shell.Library.Functions.Directory.ListDir());
            dir_ns.Set(listfn.name, listfn);

            return(dir_ns);
        }
Ejemplo n.º 4
0
        public Namespace AsNamespace()
        {
            var name_ns = new Shell.Types.Namespace(typeof(Name).Name);

            var availablefn = new Shell.Types.Function(typeof(Shell.Library.Functions.Name.Available).Name);

            availablefn.AddBuiltinLambda(new Shell.Library.Functions.Name.Available());
            name_ns.Set(availablefn.name, availablefn);

            var unsetfn = new Shell.Types.Function(typeof(Shell.Library.Functions.Name.Unset).Name);

            unsetfn.AddBuiltinLambda(new Shell.Library.Functions.Name.Unset());
            name_ns.Set(unsetfn.name, unsetfn);

            var aliasfn = new Shell.Types.Function(typeof(Shell.Library.Functions.Name.Alias).Name);

            aliasfn.AddBuiltinLambda(new Shell.Library.Functions.Name.Alias());
            name_ns.Set(aliasfn.name, aliasfn);

            return(name_ns);
        }
Ejemplo n.º 5
0
        public Namespace AsNamespace()
        {
            var data_ns = new Shell.Types.Namespace(typeof(Indexable).Name);

            var lengthfn = new Shell.Types.Function(typeof(Shell.Library.Functions.Indexable.Length).Name);

            lengthfn.AddBuiltinLambda(new Shell.Library.Functions.Indexable.Length());
            data_ns.Set(lengthfn.name, lengthfn);

            var containsfn = new Shell.Types.Function(typeof(Shell.Library.Functions.Indexable.Contains).Name);

            containsfn.AddBuiltinLambda(new Shell.Library.Functions.Indexable.Contains());
            data_ns.Set(containsfn.name, containsfn);

            var keysfn = new Shell.Types.Function(typeof(Shell.Library.Functions.Indexable.Keys).Name);

            keysfn.AddBuiltinLambda(new Shell.Library.Functions.Indexable.Keys());
            data_ns.Set(keysfn.name, keysfn);

            return(data_ns);
        }