Menu

#616 Add an OF method to Map collections

5.0.0
closed
None
none
1
2023-01-01
2014-09-25
No

Now that there is a clean syntax for creating array objects using just an expression, an OF
method for the map collections is now a workable item:

d = .directory~of((a, b), (c, d))

is a nice quick method of creating and populating a collection.

Related

Feature Requests: #616

Discussion

1 2 > >> (Page 1 of 2)
  • Rick McGuire

    Rick McGuire - 2014-09-25
    • status: unread --> accepted
    • assigned_to: Rick McGuire
    • Pending work items: none --> doc+test
    • Milestone: None --> 5.0.0
     
  • Rick McGuire

    Rick McGuire - 2014-09-25

    CodeCommitted revision [r10557].

     

    Related

    Commit: [r10557]

  • Walter

    Walter - 2014-10-09

    such as
    d = .directory~of((a, b), (c, d))
    r = .relation~of((a, b), (c, d))
    t = .table~of((a, b), (c, d))
    st= .stringtable~of((a, b), (c, d))
    it= .identitytable~of((a, b), (c, d))

    instancetable in mail was a typo, I presume!

     
    • Rick McGuire

      Rick McGuire - 2014-10-09

      Yes, you got it. The index is the first array item, the value is the
      second. The indexes need to conform to all requirements of the collection
      type, as expected. Thus the index for directory or stringtable must be as
      string.

      The arguments of processed left-to-right and added to the collection.

      Rick

      On Thu, Oct 9, 2014 at 3:16 PM, Walter walter-pachl@users.sf.net wrote:

      such as
      d = .directory~of((a, b), (c, d))
      r = .relation~of((a, b), (c, d))
      t = .table~of((a, b), (c, d))
      st= .stringtable~of((a, b), (c, d))
      it= .identitytable~of((a, b), (c, d))

      instancetable in mail was a typo, I presume!


      [feature-requests:#616] Add an OF method to Map collections

      Status: accepted
      Milestone: 5.0.0
      Created: Thu Sep 25, 2014 05:36 PM UTC by Rick McGuire
      Last Updated: Thu Sep 25, 2014 05:40 PM UTC
      Owner: Rick McGuire

      Now that there is a clean syntax for creating array objects using just an
      expression, an OF
      method for the map collections is now a workable item:

      d = .directory~of((a, b), (c, d))

      is a nice quick method of creating and populating a collection.


      Sent from sourceforge.net because you indicated interest in <
      https://sourceforge.net/p/oorexx/feature-requests/616/>

      To unsubscribe from further messages, please visit <
      https://sourceforge.net/auth/subscriptions/>

       

      Related

      Feature Requests: #616

  • Anonymous

    Anonymous - 2014-10-09

    "The arguments of processed left-to-right and added to the collection."
    arguments may override earlier ones:

    d = .directory~of((a, b),(a,b),(a, c)) ; Do e over d for 82; say e~string'->'d[e]; End
    shows A->C

     
    • Rick McGuire

      Rick McGuire - 2014-10-09

      That was only a statement in which order the items are added to the
      collections. The mapped collections themselves have no ordering. This
      statement was referring to situations like this:

      d = .directory~of(("A", 1), ("A, 2))

      say d['A']

      this will display 2, because the second argument replaces the value set by
      the first argument.

      Rick

      On Thu, Oct 9, 2014 at 5:11 PM, noreply@in.sf.net wrote:

      "The arguments of processed left-to-right and added to the collection."
      arguments may override earlier ones:

      d = .directory~of((a, b),(a,b),(a, c)) ; Do e over d for 82; say
      e~string'->'d[e]; End
      shows A->C


      [feature-requests:#616] Add an OF method to Map collections

      Status: accepted
      Milestone: 5.0.0
      Created: Thu Sep 25, 2014 05:36 PM UTC by Rick McGuire
      Last Updated: Thu Oct 09, 2014 07:16 PM UTC
      Owner: Rick McGuire

      Now that there is a clean syntax for creating array objects using just an
      expression, an OF
      method for the map collections is now a workable item:

      d = .directory~of((a, b), (c, d))

      is a nice quick method of creating and populating a collection.


      Sent from sourceforge.net because you indicated interest in <
      https://sourceforge.net/p/oorexx/feature-requests/616/>

      To unsubscribe from further messages, please visit <
      https://sourceforge.net/auth/subscriptions/>

       

      Related

      Feature Requests: #616

  • Walter

    Walter - 2014-10-09

    d = .directory~of((a, b),(a,b),(a, c)) ; Do e over d for 82; say e~string'->'d[e]; End
    d2= .directory~of((x, y),(y,z),(d, c)) ; Do e over d for 82; say e~string'->'d[e]; End

    This error message MAY be confusing:

      *-* Compiled method "PUT" with scope "Directory".
    

    1232 - Method OF with scope "MapCollection" in package "REXX" (no source available).
    34 - d2= .directory~of((x, y),(y,z),(d, c)) ;
    Error. 93 running. REXX line. 1232: Incorrect call to method.
    Error. 93.938: Method argument 2 must have a string value.

    The d in the third pair is the culprit

     
    • Rick McGuire

      Rick McGuire - 2014-10-09

      This looks like a good place to switch this error over to the named message
      type. Expect the message numbers to change in the next build.

      Rick

      On Thu, Oct 9, 2014 at 5:29 PM, Walter walter-pachl@users.sf.net wrote:

      d = .directory~of((a, b),(a,b),(a, c)) ; Do e over d for 82; say
      e~string'->'d[e]; End
      d2= .directory~of((x, y),(y,z),(d, c)) ; Do e over d for 82; say
      e~string'->'d[e]; End

      This error message MAY be confusing:

        *-* Compiled method "PUT" with scope "Directory".
      

      1232 - Method OF with scope "MapCollection" in package "REXX" (no
      source available).
      34 - d2= .directory~of((x, y),(y,z),(d, c)) ;
      Error. 93 running. REXX line. 1232: Incorrect call to method.
      Error. 93.938: Method argument 2 must have a string value.

      The d in the third pair is the culprit


      [feature-requests:#616] Add an OF method to Map collections

      Status: accepted
      Milestone: 5.0.0
      Created: Thu Sep 25, 2014 05:36 PM UTC by Rick McGuire
      Last Updated: Thu Oct 09, 2014 09:11 PM UTC
      Owner: Rick McGuire

      Now that there is a clean syntax for creating array objects using just an
      expression, an OF
      method for the map collections is now a workable item:

      d = .directory~of((a, b), (c, d))

      is a nice quick method of creating and populating a collection.


      Sent from sourceforge.net because you indicated interest in <
      https://sourceforge.net/p/oorexx/feature-requests/616/>

      To unsubscribe from further messages, please visit <
      https://sourceforge.net/auth/subscriptions/>

       

      Related

      Feature Requests: #616

  • Walter

    Walter - 2014-10-09

    Three equivalent ways to fill the directory:
    d1=.directory~of((1,A),(2,B))

    d2=.directory~new
    d2~put(A,1)
    d2~put(B,2) ---- this is why d above is argument # 2

    d3=.directory~new
    d3[1]=A
    d3[2]=B

     
    • Rick McGuire

      Rick McGuire - 2014-10-09

      Don't forget #4

      d4 = .directory~new

      On Thu, Oct 9, 2014 at 5:44 PM, Walter walter-pachl@users.sf.net wrote:

      Three equivalent ways to fill the directory:
      d1=.directory~of((1,A),(2,B))

      d2=.directory~new
      d2~put(A,1)
      d2~put(B,2) ---- this is why d above is argument # 2

      d3=.directory~new
      d3[1]=A
      d3[2]=B


      [feature-requests:#616] Add an OF method to Map collections

      Status: accepted
      Milestone: 5.0.0
      Created: Thu Sep 25, 2014 05:36 PM UTC by Rick McGuire
      Last Updated: Thu Oct 09, 2014 09:29 PM UTC
      Owner: Rick McGuire

      Now that there is a clean syntax for creating array objects using just an
      expression, an OF
      method for the map collections is now a workable item:

      d = .directory~of((a, b), (c, d))

      is a nice quick method of creating and populating a collection.


      Sent from sourceforge.net because you indicated interest in <
      https://sourceforge.net/p/oorexx/feature-requests/616/>

      To unsubscribe from further messages, please visit <
      https://sourceforge.net/auth/subscriptions/>

       

      Related

      Feature Requests: #616

      • Rick McGuire

        Rick McGuire - 2014-10-09

        Don't forget #4

        d4 = .directory~new
        d4~1 = A
        d4~2 = B

        On Thu, Oct 9, 2014 at 5:46 PM, Rick McGuire object.rexx@gmail.com wrote:

        Don't forget #4

        d4 = .directory~new

        On Thu, Oct 9, 2014 at 5:44 PM, Walter walter-pachl@users.sf.net wrote:

        Three equivalent ways to fill the directory:
        d1=.directory~of((1,A),(2,B))

        d2=.directory~new
        d2~put(A,1)
        d2~put(B,2) ---- this is why d above is argument # 2

        d3=.directory~new
        d3[1]=A
        d3[2]=B


        [feature-requests:#616] Add an OF method to Map collections

        Status: accepted
        Milestone: 5.0.0
        Created: Thu Sep 25, 2014 05:36 PM UTC by Rick McGuire
        Last Updated: Thu Oct 09, 2014 09:29 PM UTC
        Owner: Rick McGuire

        Now that there is a clean syntax for creating array objects using just an
        expression, an OF
        method for the map collections is now a workable item:

        d = .directory~of((a, b), (c, d))

        is a nice quick method of creating and populating a collection.


        Sent from sourceforge.net because you indicated interest in <
        https://sourceforge.net/p/oorexx/feature-requests/616/>

        To unsubscribe from further messages, please visit <
        https://sourceforge.net/auth/subscriptions/>

         

        Related

        Feature Requests: #616

  • Walter

    Walter - 2014-10-09

    A subtle difference or a bug??
    d=.directory~new
    d3=.directory~new
    --d3[d]=C ------ fails
    d4=.directory~new
    d4~d=Z ------ works !!!!

     
    • Rick McGuire

      Rick McGuire - 2014-10-09

      Not even a subtle difference. The value you are trying to use as an index
      in the first is a directory item, but the message form uses a string.
      Definitely NOT a bug.

      Rick

      On Thu, Oct 9, 2014 at 6:05 PM, Walter walter-pachl@users.sf.net wrote:

      A subtle difference or a bug??
      d=.directory~new
      d3=.directory~new
      --d3[d]=C ------ fails
      d4=.directory~new
      d4~d=Z ------ works !!!!


      [feature-requests:#616] Add an OF method to Map collections

      Status: accepted
      Milestone: 5.0.0
      Created: Thu Sep 25, 2014 05:36 PM UTC by Rick McGuire
      Last Updated: Thu Oct 09, 2014 09:44 PM UTC
      Owner: Rick McGuire

      Now that there is a clean syntax for creating array objects using just an
      expression, an OF
      method for the map collections is now a workable item:

      d = .directory~of((a, b), (c, d))

      is a nice quick method of creating and populating a collection.


      Sent from sourceforge.net because you indicated interest in <
      https://sourceforge.net/p/oorexx/feature-requests/616/>

      To unsubscribe from further messages, please visit <
      https://sourceforge.net/auth/subscriptions/>

       

      Related

      Feature Requests: #616

  • Walter

    Walter - 2014-10-10

    I have started some test cases and marked the 'surprising' results with ????
    I indtend to add these tests to the existing Directory.testgroup
    And ask for additional ideas

     
  • Rick McGuire

    Rick McGuire - 2014-10-10

    Well, it would help if you had indicated why you thought those were surprising results, so I'm going to have to guess here.

    test_of_4

    Don't know why you think this is surprising. The variable D evaluates to the directory object you created on the line before...which is most definitely NOT a string value. Come on Walter, this is basic Rexx.

    test_for_2 and test_for_3

    As I stated yesterday, map collections are not ordered. When you iterate through a collection it has no relationship to the order in which the items were added. There is no situation where this could be considered a valid test to add.

     
  • Walter

    Walter - 2014-10-10

    but I did show what I expected (erroneously)
    e.g. the Floop over FOR 0 should leave the undefined.

    And can you throw ideas at me?

     
    • Rick McGuire

      Rick McGuire - 2014-10-10

      No, you only assert that you expect it to be undefined, but you do not
      explain WHY you expect it to be undefined.

      If the FOR 0 on the DO loop does not prevent the control variable from
      getting updated during the initial part of the loop.

      Rick

      On Fri, Oct 10, 2014 at 11:46 AM, Walter walter-pachl@users.sf.net wrote:

      but I did show what I expected (erroneously)
      e.g. the Floop over FOR 0 should leave the undefined.

      And can you throw ideas at me?


      [feature-requests:#616] Add an OF method to Map collections

      Status: accepted
      Milestone: 5.0.0
      Created: Thu Sep 25, 2014 05:36 PM UTC by Rick McGuire
      Last Updated: Fri Oct 10, 2014 03:33 PM UTC
      Owner: Rick McGuire

      Now that there is a clean syntax for creating array objects using just an
      expression, an OF
      method for the map collections is now a workable item:

      d = .directory~of((a, b), (c, d))

      is a nice quick method of creating and populating a collection.


      Sent from sourceforge.net because you indicated interest in <
      https://sourceforge.net/p/oorexx/feature-requests/616/>

      To unsubscribe from further messages, please visit <
      https://sourceforge.net/auth/subscriptions/>

       

      Related

      Feature Requests: #616

      • Walter Pachl

        Walter Pachl - 2014-10-10

        Ok. Thanks

        Ideas?

        Von: Rick McGuire [mailto:bigrixx@users.sf.net]
        Gesendet: Freitag, 10. Oktober 2014 17:53
        An: [oorexx:feature-requests]
        Betreff: [oorexx:feature-requests] Re: #616 Add an OF method to Map
        collections

        No, you only assert that you expect it to be undefined, but you do not
        explain WHY you expect it to be undefined.

        If the FOR 0 on the DO loop does not prevent the control variable from
        getting updated during the initial part of the loop.

        Rick

        On Fri, Oct 10, 2014 at 11:46 AM, Walter walter-pachl@users.sf.net
        walter-pachl@users.sf.net wrote:

        but I did show what I expected (erroneously)
        e.g. the Floop over FOR 0 should leave the undefined.

        And can you throw ideas at me?


        [feature-requests:#616]
        http://sourceforge.net/p/oorexx/feature-requests/616 Add an OF method to
        Map collections

        Status: accepted
        Milestone: 5.0.0
        Created: Thu Sep 25, 2014 05:36 PM UTC by Rick McGuire
        Last Updated: Fri Oct 10, 2014 03:33 PM UTC
        Owner: Rick McGuire

        Now that there is a clean syntax for creating array objects using just an
        expression, an OF
        method for the map collections is now a workable item:

        d = .directory~of((a, b), (c, d))

        is a nice quick method of creating and populating a collection.


        Sent from sourceforge.net because you indicated interest in <
        https://sourceforge.net/p/oorexx/feature-requests/616/
        https://sourceforge.net/p/oorexx/feature-requests/616 >

        To unsubscribe from further messages, please visit <
        https://sourceforge.net/auth/subscriptions/
        https://sourceforge.net/auth/subscript-disabledions >


        [feature-requests:#616]
        http://sourceforge.net/p/oorexx/feature-requests/616 Add an OF method to
        Map collections

        Status: accepted
        Milestone: 5.0.0
        Created: Thu Sep 25, 2014 05:36 PM UTC by Rick McGuire
        Last Updated: Fri Oct 10, 2014 03:46 PM UTC
        Owner: Rick McGuire

        Now that there is a clean syntax for creating array objects using just an
        expression, an OF
        method for the map collections is now a workable item:

        d = .directory~of((a, b), (c, d))

        is a nice quick method of creating and populating a collection.


        Sent from sourceforge.net because you indicated interest in
        https://sourceforge.net/p/oorexx/feature-requests/616/
        https://sourceforge.net/p/oorexx/feature-requests/616

        To unsubscribe from further messages, please visit
        https://sourceforge.net/auth/subscriptions/
        https://sourceforge.net/auth/subscript-disabledions

         

        Related

        Feature Requests: #616

        • Rick McGuire

          Rick McGuire - 2014-10-10

          Sorry, ideas about what?

          On Fri, Oct 10, 2014 at 12:09 PM, Walter Pachl wpachlgeshi@users.sf.net
          wrote:

          Ok. Thanks

          Ideas?

          Von: Rick McGuire [mailto:bigrixx@users.sf.net]
          Gesendet: Freitag, 10. Oktober 2014 17:53
          An: [oorexx:feature-requests]
          Betreff: [oorexx:feature-requests] Re: #616 Add an OF method to Map
          collections

          No, you only assert that you expect it to be undefined, but you do not
          explain WHY you expect it to be undefined.

          If the FOR 0 on the DO loop does not prevent the control variable from
          getting updated during the initial part of the loop.

          Rick

          On Fri, Oct 10, 2014 at 11:46 AM, Walter walter-pachl@users.sf.net
          walter-pachl@users.sf.net wrote:

          but I did show what I expected (erroneously)
          e.g. the Floop over FOR 0 should leave the undefined.

          And can you throw ideas at me?


          [feature-requests:#616]
          http://sourceforge.net/p/oorexx/feature-requests/616 Add an OF method
          to
          Map collections

          Status: accepted
          Milestone: 5.0.0
          Created: Thu Sep 25, 2014 05:36 PM UTC by Rick McGuire
          Last Updated: Fri Oct 10, 2014 03:33 PM UTC
          Owner: Rick McGuire

          Now that there is a clean syntax for creating array objects using just an
          expression, an OF
          method for the map collections is now a workable item:

          d = .directory~of((a, b), (c, d))

          is a nice quick method of creating and populating a collection.


          Sent from sourceforge.net because you indicated interest in <
          https://sourceforge.net/p/oorexx/feature-requests/616/
          https://sourceforge.net/p/oorexx/feature-requests/616 >

          To unsubscribe from further messages, please visit <
          https://sourceforge.net/auth/subscriptions/
          https://sourceforge.net/auth/subscript-disabledions >


          [feature-requests:#616]
          http://sourceforge.net/p/oorexx/feature-requests/616 Add an OF method
          to
          Map collections

          Status: accepted
          Milestone: 5.0.0
          Created: Thu Sep 25, 2014 05:36 PM UTC by Rick McGuire
          Last Updated: Fri Oct 10, 2014 03:46 PM UTC
          Owner: Rick McGuire

          Now that there is a clean syntax for creating array objects using just an
          expression, an OF
          method for the map collections is now a workable item:

          d = .directory~of((a, b), (c, d))

          is a nice quick method of creating and populating a collection.


          Sent from sourceforge.net because you indicated interest in
          https://sourceforge.net/p/oorexx/feature-requests/616/
          https://sourceforge.net/p/oorexx/feature-requests/616

          To unsubscribe from further messages, please visit
          https://sourceforge.net/auth/subscriptions/
          https://sourceforge.net/auth/subscript-disabledions


          [feature-requests:#616] Add an OF method to Map collections

          Status: accepted
          Milestone: 5.0.0
          Created: Thu Sep 25, 2014 05:36 PM UTC by Rick McGuire
          Last Updated: Fri Oct 10, 2014 03:46 PM UTC
          Owner: Rick McGuire

          Now that there is a clean syntax for creating array objects using just an
          expression, an OF
          method for the map collections is now a workable item:

          d = .directory~of((a, b), (c, d))

          is a nice quick method of creating and populating a collection.


          Sent from sourceforge.net because you indicated interest in <
          https://sourceforge.net/p/oorexx/feature-requests/616/>

          To unsubscribe from further messages, please visit <
          https://sourceforge.net/auth/subscriptions/>

           

          Related

          Feature Requests: #616

          • Walter Pachl

            Walter Pachl - 2014-10-10

            about test cases for of & for

            Walter Pachl

             
            • Rick McGuire

              Rick McGuire - 2014-10-10

              Well, for the OF testcases, I don't see many tests for the index-value
              pairs. So, just off of the top of my head, you should have tests like
              these:

              d~of(.nil) -- not an array
              d~((1,)) -- index no value

              On Fri, Oct 10, 2014 at 12:19 PM, Walter Pachl wpachlgeshi@users.sf.net
              wrote:

              about test cases for of & for

              Walter Pachl


              [feature-requests:#616] Add an OF method to Map collections

              Status: accepted
              Milestone: 5.0.0
              Created: Thu Sep 25, 2014 05:36 PM UTC by Rick McGuire
              Last Updated: Fri Oct 10, 2014 03:46 PM UTC
              Owner: Rick McGuire

              Now that there is a clean syntax for creating array objects using just an
              expression, an OF
              method for the map collections is now a workable item:

              d = .directory~of((a, b), (c, d))

              is a nice quick method of creating and populating a collection.


              Sent from sourceforge.net because you indicated interest in <
              https://sourceforge.net/p/oorexx/feature-requests/616/>

              To unsubscribe from further messages, please visit <
              https://sourceforge.net/auth/subscriptions/>

               

              Related

              Feature Requests: #616

            • Rick McGuire

              Rick McGuire - 2014-10-10

              Well, for the OF testcases, I don't see many tests for the index-value
              pairs. So, just off of the top of my head, you should have tests like
              these:

              d~of(.nil) -- not an array
              d~of((1,)) -- index no value
              d~of((,2)) -- value, no index
              d~of((1,2,3)) -- to many items in the array

              And of course, directory and string table should have tests where the index
              is not a string value,
              relation should have tests where the same index is specified more than
              once.

              I don't recall seeing a test where the same index is specified more than
              once in a single OF call to demonstrate that the insertion order goes
              left-to-right.

              On Fri, Oct 10, 2014 at 12:19 PM, Walter Pachl wpachlgeshi@users.sf.net
              wrote:

              about test cases for of & for

              Walter Pachl


              [feature-requests:#616] Add an OF method to Map collections

              Status: accepted
              Milestone: 5.0.0
              Created: Thu Sep 25, 2014 05:36 PM UTC by Rick McGuire
              Last Updated: Fri Oct 10, 2014 03:46 PM UTC
              Owner: Rick McGuire

              Now that there is a clean syntax for creating array objects using just an
              expression, an OF
              method for the map collections is now a workable item:

              d = .directory~of((a, b), (c, d))

              is a nice quick method of creating and populating a collection.


              Sent from sourceforge.net because you indicated interest in <
              https://sourceforge.net/p/oorexx/feature-requests/616/>

              To unsubscribe from further messages, please visit <
              https://sourceforge.net/auth/subscriptions/>

               

              Related

              Feature Requests: #616

  • Rick McGuire

    Rick McGuire - 2014-10-13
    • Pending work items: doc+test --> doc
     
1 2 > >> (Page 1 of 2)

Anonymous
Anonymous

Add attachments
Cancel