Пример #1
0
        public static Readtable GetStandardReadtable()
        {
            var table = new Readtable();

            table.Init();
            return(table);
        }
Пример #2
0
        public static void RestartVariables()
        {
            ReadDecimalNumbers = true;
            GentempCounter     = 0;
            LispPackage        = null;
            KeywordPackage     = null;
            UserPackage        = null;
            Documentation      = new Dictionary <object, string>();
            Packages           = new Dictionary <string, Package>();
            PackagesByType     = new Dictionary <Type, Package>();
            Types = new Dictionary <Symbol, object>();

            InitRandom();

            DefaultReadtable = GetStandardReadtable();
        }
Пример #3
0
        public static Readtable CopyReadtable(params object[] kwargs)
        {
            var args   = ParseKwargs(kwargs, new string[] { "readtable" }, GetReadtable());
            var source = (Readtable)args[0];
            var dest   = new Readtable();

            if (source == null)
            {
                dest.Init();
            }
            else
            {
                for (var i = 0; i < source.Items.Length; ++i)
                {
                    dest.Items[i] = source.Items[i].Clone();
                }
                foreach (var pair in source.OtherItems)
                {
                    dest.OtherItems[pair.Key] = pair.Value.Clone();
                }
            }
            return(dest);
        }