On Sat, Oct 6, 2012 at 4:49 PM, Walter Pachl
<christel.u.w.pa...@chello.at>wrote:

> Before I enter another invalid bug
> (is 1122 really invalid? Why does makestring not use the required string
> value of objects
> and is the use of null string worth documenting?)
>

Obviously you didn't learn a lesson from the previous discussion.  The only
way you can get this fixed is to open a bug report.  Whether you do or not
is your decision.


>
> here is a little program and 2 questions:
> Q1: Why is 1 A in relation r12 (it is in r2)
>

There are two (1,A) pairs in r1, only one in r2, so the difference only
removes one of those.


> Q2: Why is r1a identical to r1 (is array's index 1 not the same as
> relation's index 1?)
>

This is the general principle described in section 5.3.19.4,  Since the
array is an ordered collection, it is coerced into a map collection by
using the array items for both the index and item.  Thus the matching pairs
are (A,A), (B,B), and (E,E), so no items are removed.

Rick


>
> 5.3.13.10. difference
> >>-difference(argument)----------------------------------------><
> Returns a new Relation containing only those items that the argument
> collection does not contain (with
> the same associated index). (Q1)
> The argument can be any collection class object. (Q2)
>
> r1=.relation~new ;r1[1]='A'; r1[2]='B'; r1[3]='C'; r1[1]='A'
> r2=.relation~new ;r2[1]='A'; r2[2]='B'; r2[3]='E'
> Call show_relation 'r1',r1   -- r1 / 1 A / 2 B / 3 C / 1 A
> Call show_relation 'r2',r2   -- r2 / 1 A / 2 B / 3 E
> r12=r1~difference(r2);
> Call show_relation 'r12',r12 -- r12 / 1 A / 3 C
> a2=.array~new ;a2[1]='A'; a2[2]='B'; a2[3]='E'
> r1a=r1~difference(a2);
> Call show_relation 'r1a',r1a -- r1a / 1 A / 2 B / 3 C / 1 A
> Exit
> show_relation: Procedure
>  Use Arg tag,r
>   s=r~supplier
>   Call show_supplier tag,s
>   Return
>
> show_supplier: Procedure
>   Use Arg tag,s
>   ol=tag
>   do while s~available
>     ol=ol '/' s~index s~item
>     s~next
>     End
>   Say ol
>   Return
>
>
> ------------------------------------------------------------------------------
> Don't let slow site performance ruin your business. Deploy New Relic APM
> Deploy New Relic app performance management and know exactly
> what is happening inside your Ruby, Python, PHP, Java, and .NET app
> Try New Relic at no cost today and get our sweet Data Nerd shirt too!
> http://p.sf.net/sfu/newrelic-dev2dev
> _______________________________________________
> Oorexx-devel mailing list
> Oorexx-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-devel
>
------------------------------------------------------------------------------
Don't let slow site performance ruin your business. Deploy New Relic APM
Deploy New Relic app performance management and know exactly
what is happening inside your Ruby, Python, PHP, Java, and .NET app
Try New Relic at no cost today and get our sweet Data Nerd shirt too!
http://p.sf.net/sfu/newrelic-dev2dev
_______________________________________________
Oorexx-devel mailing list
Oorexx-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-devel

Reply via email to