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


C# ISeq类代码示例

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


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

示例1: StreamSeq

 /// <summary>
 /// Construct a <see cref="StreamSeq">StreamSeq</see> from metadata and first/rest.
 /// </summary>
 /// <param name="meta">The metadata to attach</param>
 /// <param name="first">The first item.</param>
 /// <param name="rest">The rest of the sequence.</param>
 StreamSeq(IPersistentMap meta, Object first, ISeq rest)
     : base(meta)
 {
     _first = first;
     _rest = rest;
     _stream = null;
 }
开发者ID:arohner,项目名称:clojure-contrib,代码行数:13,代码来源:StreamSeq.cs

示例2: VerifyISeqRestMaintainsMeta

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

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

示例3: VerifyISeqCons

        public void VerifyISeqCons(ISeq s, object newVal, IList<object> values)
        {
            ISeq newSeq = s.cons(newVal);

            Expect(newSeq.first(), EqualTo(newVal));
            VerifyISeqContents(newSeq.rest(), values);
        }
开发者ID:arohner,项目名称:clojure-contrib,代码行数:7,代码来源:ISeqTestHelper.cs

示例4: create

 public static PersistentTreeSet create(IComparer comp, ISeq init)
 {
     PersistentTreeSet ret = new PersistentTreeSet(null, new PersistentTreeMap(null, comp));
     for (ISeq s = init; s != null; s = s.next())
         ret = (PersistentTreeSet)ret.cons(s.first());
     return ret;
 }
开发者ID:TerabyteX,项目名称:clojure-clr,代码行数:7,代码来源:PersistentTreeSet.cs

示例5: 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

示例6: MemberDef

 protected MemberDef(IImSeq<Annotation> annotations, ISeq<CustomAttribute> customAttributes, string name, bool isStatic)
 {
     Annotations = annotations ?? Constants.EmptyAnnotations;
     CustomAttributes = customAttributes ?? new Seq<CustomAttribute>();
     Name = name;
     IsStatic = isStatic;
 }
开发者ID:modulexcite,项目名称:IL2JS,代码行数:7,代码来源:MemberDef.cs

示例7: ComputeNames

        // This naming convention drawn from the Java code.
        internal void ComputeNames(ISeq form, string name)
        {
            ObjMethod enclosingMethod = (ObjMethod)Compiler.MethodVar.deref();

            string baseName = enclosingMethod != null
                ? enclosingMethod.Objx.Name
                : Compiler.munge(Compiler.CurrentNamespace.Name.Name) + "$";

            Symbol nm = RT.second(form) as Symbol;

            if (nm != null )
            {
                name = nm.Name + "__" + RT.nextID();
            }
            else
            {
                if (name == null)
                    name = "fn__" + RT.nextID();
                else if (enclosingMethod != null)
                    name += "__" + RT.nextID();
            }

            string simpleName = Compiler.munge(name).Replace(".", "_DOT_");

            Name = baseName + simpleName;
            InternalName = Name.Replace('.', '/');
        }
开发者ID:clojure,项目名称:clojure-clr,代码行数:28,代码来源:FnExpr.cs

示例8: 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

示例9: 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

示例10: FnSeq

 /// <summary>
 /// Initialize from given metatadata, plus first, restFn, rest.
 /// </summary>
 /// <param name="meta">The metadata to attach</param>
 /// <param name="first">The first of the sequence.</param>
 /// <param name="restFn">The function to generate the next value.</param>
 /// <param name="rest">The rest of the sequence..</param>
 FnSeq(IPersistentMap meta, object first, IFn restFn, ISeq rest)
     : base(meta)
 {
     _first = first;
     _restFn = restFn;
     _rest = rest;
 }
开发者ID:arohner,项目名称:clojure-contrib,代码行数:14,代码来源:FnSeq.cs

示例11: GenerateInterface

        public static Type GenerateInterface(string iName, ISeq extends, ISeq methods)
        {
            GenContext context = new GenContext(iName, CompilerMode.File);

            //            GenContext context = (GenContext)Compiler.COMPILER_CONTEXT.deref();
            //            if (context == null)
            //            {
            //#if DEBUG
            //                context = new GenContext(iName, CompilerMode.File);
            //#else
            //                throw new InvalidOperationException("No compiler context on the stack.");
            //#endif
            //            }

            Type[] interfaceTypes = GenClass.CreateTypeArray(extends == null ? null : extends.seq());

            TypeBuilder proxyTB = context.ModuleBldr.DefineType(
                iName,
                TypeAttributes.Interface | TypeAttributes.Public | TypeAttributes.Abstract,
                null,
                interfaceTypes);

            DefineMethods(proxyTB, methods);

            Type t = proxyTB.CreateType();
            context.AssyBldr.Save(iName  + ".dll");
            return t;
        }
开发者ID:starapor,项目名称:clojure-clr,代码行数:28,代码来源:GenInterface.cs

示例12: GenerateProxyClass

        public static Type GenerateProxyClass(Type superclass, ISeq interfaces, string className)
        {
            //Console.WriteLine("Defining proxy class {0} with base {1}", className, superclass);

            // define the class
            List<Type> interfaceTypes = new List<Type>();
            interfaceTypes.Add(typeof(IProxy));

            for (ISeq s = interfaces; s != null; s = s.next())
                interfaceTypes.Add((Type)s.first());

            TypeBuilder proxyTB = _context.ModuleBldr.DefineType(
                className,
                TypeAttributes.Class | TypeAttributes.Public | TypeAttributes.Sealed,
                superclass,
                interfaceTypes.ToArray());

            DefineCtors(proxyTB, superclass);
            FieldBuilder mapField = AddIProxyMethods(proxyTB);

            HashSet<Type> allInterfaces = GetAllInterfaces(interfaces);
            HashSet<MethodBuilder> specialMethods = new HashSet<MethodBuilder>();

            AddInterfaceMethods(proxyTB, mapField, superclass, allInterfaces, specialMethods);
            AddInterfaceProperties(proxyTB, superclass, allInterfaces, specialMethods ); // Must follow AddInterfaceMethods

            return proxyTB.CreateType();
        }
开发者ID:starapor,项目名称:clojure-clr,代码行数:28,代码来源:GenProxy.cs

示例13: Cycle

 private Cycle(IPersistentMap meta, ISeq all, ISeq prev, ISeq current, ISeq next)
     :base(meta)
 {
     _all = all;
     _prev = prev;
     _current = current;
     _next = next;
 }
开发者ID:TerabyteX,项目名称:clojure-clr,代码行数:8,代码来源:Cycle.cs

示例14: Iterate

 private Iterate(IPersistentMap meta, IFn f, Object prevSeed, Object seed, ISeq next)
     :base(meta)
 {
     _f = f;
     _prevSeed = prevSeed;
     _seed = seed;
     _next = next;
 }
开发者ID:TerabyteX,项目名称:clojure-clr,代码行数:8,代码来源:Iterate.cs

示例15: 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


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