Talk:Symmetric difference: Difference between revisions

m
added a section header to the first topic to properly place the table-of-contents (TOC) --- (this happens more often than one would think).
m (→‎REXX Version 2: added a sentence, corrected HTML grammer. -- ~~~~)
m (added a section header to the first topic to properly place the table-of-contents (TOC) --- (this happens more often than one would think).)
 
(4 intermediate revisions by 2 users not shown)
Line 1:
== symmetric difference should ... ==
 
The symmetric difference should give one list which is the union of the two differences of the lists. The Perl example shows two lists. --[[User:Mwn3d|Mwn3d]] 23:19, 2 December 2009 (UTC)
 
Line 114 ⟶ 116:
As for the '''translate''' that you used (above), it removes commas (''','''), quotes ('''"'''), right and left brackets ('''][''') from the values, not just the delimiters. Now, the values shown don't have any of those characters, but still, it's good to program ''as if'' those values had them.
Once those characters are handled correctly, it's one small step to handle blanks and nulls. That's why the REXX versions 1 and 1.5 took extra precautions (more REXX code) to only ''strip'' those characters used as delimiters and not ''translate'' them out of existence. (well, translate them to blanks). Furthermore, the older REXX entries can also handle ''null'' values, which are legal in SETs. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 19:40, 16 December 2013 (UTC)
 
: Note 1 starts with: " If your code uses lists of items to represent sets ..."
Mine does not!
<br>Please let's end the discussion. My version handles sets that consist of elements not containing blanks (or maybe whitespace) period (The task descripion uses exactly such elements.) Prove the opposite or delete the invalid tag --[[User:Walterpachl|Walterpachl]] ([[User talk:Walterpachl|talk]]) 20:09, 16 December 2013 (UTC)
 
Well, yes, Walter, it does use lists. Saying it doesn't use a list doesn't make it so. The lists used can look like SET elements, and indeed, represent elements in a SET. All you have to do is use the lists that ''note 1'' suggests to use (stating again, as does GAP, Pike, and Prolog use, among others, including REXX version 1 and 1.5). I have already executed the earlier version of the REXX version 2 with duplicates and it failed. I haven't gone through that process and validated it for you since the REXX version 2 was changed. If you could incorporate the new lists (using duplicates) as per the task's requirements (''note 1'') and post the output to show that it handles duplicates correctly, than you can delete the tag, and we all know thereafter that duplicates in the lists are handled correctly. (I don't want to modify your program nor its output.) If you want me to modify the REXX version 2 program and its output, I can do that for you, but since you have your moniker on it, I left them intact.) Note that other programming examples do use SETs, and some of them still incorporated duplicates in the element lists, and handled them correctly, even though they didn't use lists to represent SETs. I know it seems to be a nit, but I shouldn't have to prove it wrong (what if I or others don't have a REXX interpreter that could execute/interpret the code?), all is needed is to show that the REXX version 2 code can handle duplicates. That's why output is shown, as a verification. There isn't a need to have this discussion; if it's that hard to add duplicates to the lists and verify the output, just remove the tag. It would be much simpler to just add the duplicates (as per what ''note 1'' suggests) and show the output from using those lists. -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 21:03, 16 December 2013 (UTC)
:: but I DID change the program! It handles duplicates now correctly. --[[User:Walterpachl|Walterpachl]] ([[User talk:Walterpachl|talk]]) 21:13, 16 December 2013 (UTC)
 
::: Yes, good work! -- [[User:Gerard Schildberger|Gerard Schildberger]] ([[User talk:Gerard Schildberger|talk]]) 21:25, 16 December 2013 (UTC)