当前位置: 首页>>代码示例>>C#>>正文


C# ISeq.next方法代码示例

本文整理汇总了C#中ISeq.next方法的典型用法代码示例。如果您正苦于以下问题:C# ISeq.next方法的具体用法?C# ISeq.next怎么用?C# ISeq.next使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISeq的用法示例。


在下文中一共展示了ISeq.next方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: VerifyISeqRestMaintainsMeta

        public void VerifyISeqRestMaintainsMeta(ISeq s)
        {
            IPersistentMap meta = ((IMeta)s).meta();

            for (; s.next() != null; s = s.next())
                Expect(((IMeta)s.next()).meta(), EqualTo(meta));
        }
开发者ID:TerabyteX,项目名称:clojure-clr,代码行数:7,代码来源:ISeqTestHelper.cs

示例2: create

 /// <summary>
 /// Create a <see cref="PersistentHashSet">PersistentHashSet</see> initialized from an <see cref="ISeq">ISeq</see> of items.
 /// </summary>
 /// <param name="items">An <see cref="ISeq">ISeq</see> of items</param>
 /// <returns>A <see cref="PersistentHashSet">PersistentHashSet</see>.</returns>
 public static PersistentHashSet create(ISeq items)
 {
     PersistentHashSet ret = EMPTY;
     for (; items != null; items = items.next())
         ret = (PersistentHashSet)ret.cons(items.first());
     return ret;
 }
开发者ID:starapor,项目名称:clojure-clr,代码行数:12,代码来源:PersistentHashSet.cs

示例3: create

 public static PersistentHashSet create(ISeq items)
 {
     ITransientSet ret = (ITransientSet)EMPTY.asTransient(); 
     for (; items != null; items = items.next())
         ret = (ITransientSet)ret.conj(items.first());
     return (PersistentHashSet)ret.persistent();
 }
开发者ID:TerabyteX,项目名称:clojure-clr,代码行数:7,代码来源:PersistentHashSet.cs

示例4: Parse

 public static Expr Parse(ISeq form)
 {
     Expr fexpr = Compiler.GenerateAST(form.first());
     IPersistentVector args = PersistentVector.EMPTY;
     for ( ISeq s = RT.seq(form.next()); s != null; s = s.next())
         args = args.cons(Compiler.GenerateAST(s.first()));
     return new InvokeExpr(Compiler.TagOf(form),fexpr,args);
 }
开发者ID:kmartin,项目名称:clojure-contrib,代码行数:8,代码来源:InvokeExpr.cs

示例5: Parse

 public static Expr Parse(ISeq form)
 {
     Expr fexpr = Compiler.GenerateAST(form.first(),false);
     IPersistentVector args = PersistentVector.EMPTY;
     for ( ISeq s = RT.seq(form.next()); s != null; s = s.next())
         args = args.cons(Compiler.GenerateAST(s.first(),false));
     return new InvokeExpr((string)Compiler.SOURCE.deref(),(int)Compiler.LINE.deref(),Compiler.TagOf(form),fexpr,args);
 }
开发者ID:starapor,项目名称:clojure-clr,代码行数:8,代码来源:InvokeExpr.cs

示例6: VerifyISeqContents

        public void VerifyISeqContents(ISeq s, IList<object> values)
        {
            int i=0;

            for (; s != null; s = s.next(), i++)
                Expect(s.first(), EqualTo(values[i]));

            Expect(i, EqualTo(values.Count));
        }
开发者ID:TerabyteX,项目名称:clojure-clr,代码行数:9,代码来源:ISeqTestHelper.cs

示例7: construct

 /// <summary>
 /// Create a struct from a struct definition and values (in order) for the fixed keys.
 /// </summary>
 /// <param name="def">A struct definition</param>
 /// <param name="valseq">A sequence of values for the fixed keys (in definition order).</param>
 /// <returns>A <see cref="PersistentStructMap">PersistentStructMap</see>.</returns>
 public static PersistentStructMap construct(Def def, ISeq valseq)
 {
     object[] vals = new object[def.Keyslots.count()];
     IPersistentMap ext = PersistentHashMap.EMPTY;
     for (int i = 0; i < vals.Length && valseq != null; valseq = valseq.next(), i++)
     {
         vals[i] = valseq.first();
     }
     if (valseq != null)
         throw new ArgumentException("Too many arguments to struct constructor");
     return new PersistentStructMap(null, def, vals, ext);
 }
开发者ID:christianblunden,项目名称:clojure-clr,代码行数:18,代码来源:PersistentStructMap.cs

示例8: createWithCheck

 public static PersistentHashMap createWithCheck(ISeq items)
 {
     ITransientMap ret = (ITransientMap)EMPTY.asTransient();
     for (int i = 0; items != null; items = items.next().next(), ++i)
     {
         if (items.next() == null)
             throw new ArgumentException(String.Format("No value supplied for key: {0}", items.first()));
         ret = ret.assoc(items.first(), RT.second(items));
         if (ret.count() != i + 1)
             throw new ArgumentException("Duplicate key: " + items.first());
     }
     return (PersistentHashMap)ret.persistent();
 }
开发者ID:davidadsit,项目名称:clojure-clr,代码行数:13,代码来源:PersistentHashMap.cs

示例9: create

 /// <summary>
 /// Create a struct from a struct definition and a sequence of alternating keys and values.
 /// </summary>
 /// <param name="def">The struct definition</param>
 /// <param name="keyvals">A sequence of alternating keys and values.</param>
 /// <returns>A <see cref="PersistentStructMap">PersistentStructMap</see>.</returns>
 public static PersistentStructMap create(Def def, ISeq keyvals)
 {
     object[] vals = new object[def.Keyslots.count()];
     IPersistentMap ext = PersistentHashMap.EMPTY;
     for (; keyvals != null; keyvals = keyvals.next().next())
     {
         if (keyvals.next() == null)
             throw new ArgumentException(String.Format("No value supplied for key: {0}", keyvals.first()));
         object k = keyvals.first();
         object v = RT.second(keyvals);
         IMapEntry me = def.Keyslots.entryAt(k);
         if (me != null)
             vals[Util.ConvertToInt(me.val())] = v;
         else
             ext = ext.assoc(k, v);
     }
     return new PersistentStructMap(null, def, vals, ext);
 }
开发者ID:christianblunden,项目名称:clojure-clr,代码行数:24,代码来源:PersistentStructMap.cs

示例10: FindKey

 // do we need this?
 protected static ISeq FindKey(object key, ISeq args)
 {
     while (args != null)
     {
         if (key == args.first())
             return args.next();
         args = RT.next(args);
         args = RT.next(args);
     }
     return null;
 }
开发者ID:kmartin,项目名称:clojure-contrib,代码行数:12,代码来源:RestFn.cs

示例11: create

 /// <summary>
 /// Create a <see cref="PersistentVector">PersistentVector</see> from an <see cref="ISeq">ISeq</see>.
 /// </summary>
 /// <param name="items">A sequence of items.</param>
 /// <returns>An initialized vector.</returns>
 public static PersistentVector create(ISeq items)
 {
     IPersistentVector ret = EMPTY;
     for (; items != null; items = items.next())
         ret = ret.cons(items.first());
     return (PersistentVector)ret;
 }
开发者ID:kmartin,项目名称:clojure-contrib,代码行数:12,代码来源:PersistentVector.cs

示例12: applyTo

        public override object applyTo(ISeq args)
        {
            int reqArity = getRequiredArity();

            if (RT.BoundedLength(args, reqArity) <= reqArity)
                return AFn.ApplyToHelper(this, Util.Ret1(args, args = null));

            switch (reqArity)
            {
                case 0:
                    return doInvoke(Util.Ret1(args, args = null));
                case 1:
                    return doInvoke(args.first()
                            , Util.Ret1(args.next(), args = null));
                case 2:
                    return doInvoke(args.first()
                            , (args = args.next()).first()
                            , Util.Ret1(args.next(), args = null));
                case 3:
                    return doInvoke(args.first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , Util.Ret1(args.next(), args = null));
                case 4:
                    return doInvoke(args.first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , Util.Ret1(args.next(), args = null));
                case 5:
                    return doInvoke(args.first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , Util.Ret1(args.next(), args = null));
                case 6:
                    return doInvoke(args.first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , Util.Ret1(args.next(), args = null));
                case 7:
                    return doInvoke(args.first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , Util.Ret1(args.next(), args = null));
                case 8:
                    return doInvoke(args.first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , Util.Ret1(args.next(), args = null));
                case 9:
                    return doInvoke(args.first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , Util.Ret1(args.next(), args = null));
                case 10:
                    return doInvoke(args.first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , Util.Ret1(args.next(), args = null));
                case 11:
                    return doInvoke(args.first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , (args = args.next()).first()
                            , Util.Ret1(args.next(), args = null));
                case 12:
//.........这里部分代码省略.........
开发者ID:christianblunden,项目名称:clojure-clr,代码行数:101,代码来源:RestFn.cs

示例13: MacroexpandSeq1

        private static object MacroexpandSeq1(ISeq form)
        {
            object op = RT.first(form);

            if (IsSpecial(op))
                return form;

            // macro expansion
            Var v = IsMacro(op);
            if (v != null)
            {
                try
                {
                    Var.pushThreadBindings(RT.map(RT.MACRO_META, RT.meta(form)));
                    return v.applyTo(form.next());
                }
                finally
                {
                    Var.popThreadBindings();
                }
            }
            else
            {
                if (op is Symbol)
                {
                    Symbol sym = (Symbol)op;
                    string sname = sym.Name;
                    // (.substring s 2 5) => (. x substring 2 5)
                    if (sname[0] == '.')
                    {
                        if (form.count() < 2)
                            throw new ArgumentException("Malformed member expression, expecting (.member target ...)");
                        Symbol method = Symbol.intern(sname.Substring(1));
                        // TODO:  Figure out why the following change made in Java Rev 1158 breaks ants.clj
                        // Note on that revision: force instance member interpretation of (.method ClassName), e.g. (.getMethods String) works
                        //  However, when I do this, it makes ants.clj choke on: (def white-brush (new SolidBrush (.White Color)))
                        object target = RT.second(form);
                        if (MaybeType(target, false) != null)
                            //target = RT.list(IDENTITY, target);
                            target = ((IObj)RT.list(IDENTITY, target)).withMeta(RT.map(RT.TAG_KEY, CLASS));
                        return RT.listStar(DOT, target, method, form.next().next());
                        // safe substitute: return RT.listStar(Compiler.DOT, RT.second(form), method, form.next().next());
                    }
                    else if (NamesStaticMember(sym))
                    {
                        Symbol target = Symbol.intern(sym.Namespace);
                        Type t = MaybeType(target, false);
                        if (t != null)
                        {
                            Symbol method = Symbol.intern(sym.Name);
                            return RT.listStar(Compiler.DOT, target, method, form.next());
                        }
                    }
                    else
                    {
                        // (x.substring 2 5) =>  (. s substring 2 5)
                        int index = sname.LastIndexOf('.');
                        if (index == sname.Length - 1)
                            return RT.listStar(Compiler.NEW, Symbol.intern(sname.Substring(0, index)), form.next());
                    }
                }

            }
            return form;
        }
开发者ID:starapor,项目名称:clojure-clr,代码行数:65,代码来源:Compiler.cs

示例14: MacroexpandSeq1

        private static object MacroexpandSeq1(ISeq form)
        {
            object op = RT.first(form);

            if (IsSpecial(op))
                return form;

            // macro expansion
            Var v = IsMacro(op);
            if (v != null)
            {
                try
                {
                    return v.applyTo(RT.cons(form, RT.cons(LocalEnvVar.get(), form.next())));
                }
                catch (ArityException e)
                {
                    // hide the 2 extra params for a macro
                    throw new ArityException(e.Actual - 2, e.Name);
                }
            }
            else
            {
                Symbol sym = op as Symbol;
                if (sym != null)
                {
                    string sname = sym.Name;
                    // (.substring s 2 5) => (. x substring 2 5)
                    if (sname[0] == '.')
                    {
                        if (form.count() < 2)
                            throw new ArgumentException("Malformed member expression, expecting (.member target ...)");
                        Symbol method = Symbol.intern(sname.Substring(1));
                        object target = RT.second(form);
                        if (HostExpr.MaybeType(target, false) != null)
                            target = ((IObj)RT.list(IdentitySym, target)).withMeta(RT.map(RT.TagKey, ClassSym));
                        // We need to make sure source information gets transferred
                        return MaybeTransferSourceInfo(PreserveTag(form, RT.listStar(DotSym, target, method, form.next().next())), form);
                    }
                    else if (NamesStaticMember(sym))
                    {
                        Symbol target = Symbol.intern(sym.Namespace);
                        Type t = HostExpr.MaybeType(target, false);
                        if (t != null)
                        {
                            Symbol method = Symbol.intern(sym.Name);
                            // We need to make sure source information gets transferred
                            return MaybeTransferSourceInfo(PreserveTag(form, RT.listStar(Compiler.DotSym, target, method, form.next())), form);
                        }
                    }
                    else
                    {
                        // (x.substring 2 5) =>  (. x substring 2 5)
                        // also (package.class.name ... ) (. package.class name ... )
                        int index = sname.LastIndexOf('.');
                        if (index == sname.Length - 1)
                            // We need to make sure source information gets transferred
                            return MaybeTransferSourceInfo(RT.listStar(Compiler.NewSym, Symbol.intern(sname.Substring(0, index)), form.next()), form);
                    }
                }

            }
            return form;
        }
开发者ID:rvedam,项目名称:clojure-clr,代码行数:64,代码来源:Compiler.cs

示例15: MacroexpandSeq1

        private static object MacroexpandSeq1(ISeq form)
        {
            object op = RT.first(form);

            if (IsSpecial(op))
                return form;

            // macro expansion
            Var v = IsMacro(op);
            if (v != null)
            {
                // TODO: Check this against current code
                return v.applyTo(RT.cons(form, RT.cons(LOCAL_ENV.get(), form.next())));
            }
            else
            {
                if (op is Symbol)
                {
                    Symbol sym = (Symbol)op;
                    string sname = sym.Name;
                    // (.substring s 2 5) => (. x substring 2 5)
                    if (sname[0] == '.')
                    {
                        if (form.count() < 2)
                            throw new ArgumentException("Malformed member expression, expecting (.member target ...)");
                        Symbol method = Symbol.intern(sname.Substring(1));
                        object target = RT.second(form);
                        if (HostExpr.MaybeType(target, false) != null)
                            target = ((IObj)RT.list(IDENTITY, target)).withMeta(RT.map(RT.TAG_KEY, CLASS));
                        // We need to make sure source information gets transferred
                        return MaybeTransferSourceInfo(PreserveTag(form, RT.listStar(DOT, target, method, form.next().next())), form);
                    }
                    else if (NamesStaticMember(sym))
                    {
                        Symbol target = Symbol.intern(sym.Namespace);
                        Type t = HostExpr.MaybeType(target, false);
                        if (t != null)
                        {
                            Symbol method = Symbol.intern(sym.Name);
                            // We need to make sure source information gets transferred
                            return MaybeTransferSourceInfo(PreserveTag(form, RT.listStar(Compiler.DOT, target, method, form.next())), form);
                        }
                    }
                    else
                    {
                        // (x.substring 2 5) =>  (. x substring 2 5)
                        // also (package.class.name ... ) (. package.class name ... )
                        int index = sname.LastIndexOf('.');
                        if (index == sname.Length - 1)
                            // We need to make sure source information gets transferred
                            return MaybeTransferSourceInfo(RT.listStar(Compiler.NEW, Symbol.intern(sname.Substring(0, index)), form.next()), form);
                    }
                }

            }
            return form;
        }
开发者ID:christianblunden,项目名称:clojure-clr,代码行数:57,代码来源:Compiler.cs


注:本文中的ISeq.next方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。