Details

    • Type: Wish Wish
    • Status: Closed Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 0.7
    • Fix Version/s: 0.7
    • Component/s: Runtime (Boo.Lang)
    • Labels:
      None
    • Number of attachments :
      3

      Description

      Add a Mathematical Set class to Boo to support set operations.

      • A set can be created from any IEnumerable
      • Methods include: intersection, union, (left/right)difference and IsSubSet
      • Operators: a | b (union), a & b (intersection), a - b (leftdifference), a ^ b (difference), a < b (strict subset), a <= b (subset).

      Attached is a C# file that implements this proposed Set class.

      1. Set.boo
        3 kB
        Edwin de Jonge
      2. Set.cs
        7 kB
        Edwin de Jonge

        Activity

        Hide
        Hans-Christian Holm added a comment -

        The Iesi.Collections library (http://www.codeproject.com/csharp/sets.asp) could also be of interest here. The library contains a number of set classes with different features. The library is distributed with NHibernate, where the Iesi.Collections.ISet interface is used for set mappings.

        I don't see the need to distribute a set library with Boo, unless set operations should become part of the language (I guess that won't happen). The standard .NET class library could need a set class, though.

        Show
        Hans-Christian Holm added a comment - The Iesi.Collections library ( http://www.codeproject.com/csharp/sets.asp ) could also be of interest here. The library contains a number of set classes with different features. The library is distributed with NHibernate, where the Iesi.Collections.ISet interface is used for set mappings. I don't see the need to distribute a set library with Boo, unless set operations should become part of the language (I guess that won't happen). The standard .NET class library could need a set class, though.
        Hide
        Edwin de Jonge added a comment -

        Converted the Set C# class to Boo.

        Show
        Edwin de Jonge added a comment - Converted the Set C# class to Boo.
        Hide
        Arron Washington added a comment -

        Most excellent. Thanks! This will probably be introduced to Boo.Utilities when Rodrigo gets around to creating the basic framework, COUGH COUGH

        Show
        Arron Washington added a comment - Most excellent. Thanks! This will probably be introduced to Boo.Utilities when Rodrigo gets around to creating the basic framework, COUGH COUGH
        Hide
        Edwin de Jonge added a comment -

        Attached slightly adjusted Set class:

        • comments
        • removed one of the constructors that was causing a bug

        Added NUnit Test script for Set class

        Show
        Edwin de Jonge added a comment - Attached slightly adjusted Set class: comments removed one of the constructors that was causing a bug Added NUnit Test script for Set class
        Hide
        Edwin de Jonge added a comment -

        Most important thing I forgot to say:

        Please use Set.zip in stead of the other attachments

        Show
        Edwin de Jonge added a comment - Most important thing I forgot to say: Please use Set.zip in stead of the other attachments
        Hide
        Rodrigo B. de Oliveira added a comment -

        Added to the repository. Thanks!

        Show
        Rodrigo B. de Oliveira added a comment - Added to the repository. Thanks!

          People

          • Assignee:
            Unassigned
            Reporter:
            Edwin de Jonge
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 10 minutes
              10m
              Remaining:
              Remaining Estimate - 10 minutes
              10m
              Logged:
              Time Spent - Not Specified
              Not Specified