Пример #1
0
        public QuotedFunction(QuotedFunction first, QuotedFunction second)
        {
            mSubFxns = new CatExpr(first.GetSubFxns().ToArray());
            mSubFxns.AddRange(second.GetSubFxns().ToArray());

            msDesc = "anonymous composed function";
            msName = "";
            for (int i = 0; i < mSubFxns.Count; ++i)
            {
                if (i > 0)
                {
                    msName += " ";
                }
                msName += mSubFxns[i].GetName();
            }

            try {
                mpFxnType = new CatQuotedType(CatTypeReconstructor.ComposeTypes(first.GetFxnType(), second.GetFxnType()));
                // TODO: remove once everythign tests okay.
                //mpFxnType = new CatQuotedType(CatTypeReconstructor.ComposeTypes(first.GetUnquotedFxnType(), second.GetUnquotedFxnType()));
            } catch (Exception e) {
                Output.WriteLine("unable to type quotation: " + ToString());
                Output.WriteLine("type error: " + e.Message);
                mpFxnType = null;
            }
        }
Пример #2
0
        public static CatFxnType ComposeFxnTypes(CatFxnType f, CatFxnType g)
        {
            CatFxnType ft = CatTypeReconstructor.ComposeTypes(f, g);

            return(ft);
        }