PageRenderTime 45ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/Clojure/Clojure/Lib/IPersistentCollection.cs

https://github.com/101v/clojure-clr
C# | 56 lines | 14 code | 6 blank | 36 comment | 0 complexity | 48ca084cfb793fe8fad1bd16d28ac584 MD5 | raw file
  1. /**
  2. * Copyright (c) Rich Hickey. All rights reserved.
  3. * The use and distribution terms for this software are covered by the
  4. * Eclipse Public License 1.0 (http://opensource.org/licenses/eclipse-1.0.php)
  5. * which can be found in the file epl-v10.html at the root of this distribution.
  6. * By using this software in any fashion, you are agreeing to be bound by
  7. * the terms of this license.
  8. * You must not remove this notice, or any other, from this software.
  9. **/
  10. /**
  11. * Author: David Miller
  12. **/
  13. using System;
  14. using System.Collections.Generic;
  15. using System.Linq;
  16. using System.Text;
  17. namespace clojure.lang
  18. {
  19. /// <summary>
  20. /// Represents an immutable collection.
  21. /// </summary>
  22. /// <remarks>
  23. /// <para>Lowercase-named methods for compatibility with JVM code.</para>
  24. /// </remarks>
  25. public interface IPersistentCollection : Seqable
  26. {
  27. /// <summary>
  28. /// Gets the number of items in the collection.
  29. /// </summary>
  30. /// <returns>The number of items in the collection.</returns>
  31. int count();
  32. /// <summary>
  33. /// Returns a new collection that has the given element cons'd on front of the existing collection.
  34. /// </summary>
  35. /// <param name="o">An item to put at the front of the collection.</param>
  36. /// <returns>A new immutable collection with the item added.</returns>
  37. IPersistentCollection cons(object o);
  38. /// <summary>
  39. /// Gets an empty collection of the same type.
  40. /// </summary>
  41. /// <returns>An emtpy collection.</returns>
  42. IPersistentCollection empty();
  43. /// <summary>
  44. /// Determine if an object is equivalent to this (handles all collections).
  45. /// </summary>
  46. /// <param name="o">The object to compare.</param>
  47. /// <returns><c>true</c> if the object is equivalent; <c>false</c> otherwise.</returns>
  48. bool equiv(object o);
  49. }
  50. }