本文整理汇总了C#中ISequence.First方法的典型用法代码示例。如果您正苦于以下问题:C# ISequence.First方法的具体用法?C# ISequence.First怎么用?C# ISequence.First使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ISequence
的用法示例。
在下文中一共展示了ISequence.First方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IndexOf
public int IndexOf(object obj)
{
ISequence sequence = this.ToSequence();
for (int k = 0; sequence != null; sequence = sequence.Next(), k++)
if (Utilities.Equiv(sequence.First(), obj))
return k;
return -1;
}
示例2: Contains
public bool Contains(object obj)
{
for (ISequence sequence = this.ToSequence(); sequence != null; sequence = sequence.Next())
if (Utilities.Equiv(sequence.First(), obj))
return true;
return false;
}
示例3: CompileQuote
public static Expression CompileQuote(ISequence args, Environment environment)
{
return Expression.Constant(args.First(), typeof(object));
}
示例4: Create
public static PersistentVector Create(ISequence sequence)
{
PersistentVector vector = emptyVector;
for (; sequence != null; sequence = sequence.Next())
vector = (PersistentVector)vector.Cons(sequence.First());
return vector;
}
示例5: CompileQuasiQuote
public static Expression CompileQuasiQuote(ISequence args, Environment environment)
{
object o = CompileQuasiQuote(1, args.First(), environment);
Expression e = Expression.Constant(o, typeof(object));
Expression[] es = new Expression[2];
es[0] = e;
es[1] = environmentParameter;
e = Expression.Call(null, quasiQuoteMethodInfo, es);
return e;
}