예제 #1
0
파일: Apply.cs 프로젝트: jgouly/schemin
        public override IScheminType Execute(Environment env, Evaluator eval, ScheminList args)
        {
            IScheminType function = args.Car();
            ScheminList argList = args.Cdr();
            ScheminList toApply = (ScheminList) args.Cdr().Last();

            ScheminList list = new ScheminList();
            list.UnQuote();

            foreach (IScheminType type in toApply)
            {
                list.Append(type);
            }

            foreach (IScheminType type in argList)
            {
                if (type != toApply)
                    list.Cons(type);
            }

            list.Cons(function);

            return list;
        }