本文整理汇总了C#中clojure.lang.MapEntry.val方法的典型用法代码示例。如果您正苦于以下问题:C# MapEntry.val方法的具体用法?C# MapEntry.val怎么用?C# MapEntry.val使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类clojure.lang.MapEntry
的用法示例。
在下文中一共展示了MapEntry.val方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CtorCreatesEntryWithProperKeyVal
public void CtorCreatesEntryWithProperKeyVal()
{
MapEntry me = new MapEntry(1, "abc");
Expect(me.key(), EqualTo(1));
Expect(me.val(), EqualTo("abc"));
}
示例2: ConsWorks
public void ConsWorks()
{
MapEntry me = new MapEntry(1, "abc");
IPersistentVector v1 = me.cons(2);
Expect(me.count(), EqualTo(2));
Expect(me.key(), EqualTo(1));
Expect(me.val(), EqualTo("abc"));
Expect(v1.count(), EqualTo(3));
Expect(v1.nth(0), EqualTo(1));
Expect(v1.nth(1), EqualTo("abc"));
Expect(v1.nth(2), EqualTo(2));
}
示例3: AssocNInRangeModifies
public void AssocNInRangeModifies()
{
MapEntry me = new MapEntry(1, "abc");
IPersistentVector v1 = me.assocN(0, 2);
IPersistentVector v2 = me.assocN(1, "def");
IPersistentVector v3 = me.assocN(2, "ghi");
Expect(me.count(), EqualTo(2));
Expect(me.key(), EqualTo(1));
Expect(me.val(), EqualTo("abc"));
Expect(v1.count(), EqualTo(2));
Expect(v1.nth(0), EqualTo(2));
Expect(v1.nth(1), EqualTo("abc"));
Expect(v2.count(), EqualTo(2));
Expect(v2.nth(0), EqualTo(1));
Expect(v2.nth(1), EqualTo("def"));
Expect(v3.count(), EqualTo(3));
Expect(v3.nth(0), EqualTo(1));
Expect(v3.nth(1), EqualTo("abc"));
Expect(v3.nth(2), EqualTo("ghi"));
}
示例4: PeekReturnsVal
public void PeekReturnsVal()
{
MapEntry me = new MapEntry(1, "abc");
Expect(me.peek(), EqualTo("abc"));
Expect(me.count(), EqualTo(2));
Expect(me.key(), EqualTo(1));
Expect(me.val(), EqualTo("abc"));
}
示例5: ExplictIPersistentCollectionConsWorks
public void ExplictIPersistentCollectionConsWorks()
{
MapEntry me = new MapEntry(1, "abc");
IPersistentCollection c = (IPersistentCollection)me;
ISeq s = c.cons(2).seq();
Expect(me.count(), EqualTo(2));
Expect(me.key(), EqualTo(1));
Expect(me.val(), EqualTo("abc"));
Expect(s.count(), EqualTo(3));
Expect(s.first(), EqualTo(1));
Expect(s.next().first(), EqualTo("abc"));
Expect(s.next().next().first(), EqualTo(2));
Expect(s.next().next().next(), Null);
}