Talk:Order disjoint list items: Difference between revisions

(→‎Perl 6 entry: perl output)
Line 25:
 
There seems to be something wrong with the Perl output, probably a copy and paste error. [[User:Fwend|Fwend]] ([[User talk:Fwend|talk]]) 11:22, 4 June 2014 (UTC)
 
== Task clarification: correct behaviour with duplicates in M and/or N? ==
 
Hi, the Ruby and Scala implementations have been annotated as wrong by [[User:Bart|Bart]] but I currently believe my Scala implementation is correct according to my own interpretation of the task statement, but it’s not entirely clear. Here’s a comparison of Scala with Python and Ruby. I’ve bolded one significant difference. Note, the Python and Ruby versions fail to complete these tests:
 
'''Scala output:'''
Data M: cat cat mat Order N: mat cat -> Result M': mat cat mat
Data M: cat cat mat Order N: '''cat mat''' -> Result M': '''cat mat''' mat
Data M: cat mat Order N: mat mat -> Result M': cat mat
Data M: cat mat Order N: cat mat -> Result M': cat mat
Data M: cat mat Order N: cat mat cat -> Result M': cat mat
Data M: cat mat Order N: mat cat cat -> Result M': mat cat
 
'''Python output:'''
Data M: 'cat cat mat' Order N: 'mat cat' -> M' 'mat cat cat'
Data M: 'cat cat mat' Order N: ''''cat mat'''' -> M' ''''cat cat''' mat'
Data M: 'cat mat' Order N: 'mat cat' -> M' 'mat cat'
Data M: 'cat mat' Order N: 'cat mat' -> M' 'cat mat'
Data M: 'cat mat' Order N: 'cat mat cat' Traceback (most recent call last):
File "<stdin>", line 42, in <module>
File "<stdin>", line 11, in order_disjoint_list_items
ValueError: 'cat' is not in list
 
'''Ruby output:'''
Data M: cat cat mat Order N: mat cat -> M' mat cat mat
Data M: cat cat mat Order N: '''cat mat''' -> M' '''cat mat''' mat
-:21:in `[]=': no implicit conversion from nil to integer (TypeError)
from -:21
from -:21:in `reverse_each'
from -:21
from -:23:in `each_slice'
from -:17:in `each'
from -:17:in `each_slice'
from -:17
 
If the Scala implementation is incorrect, can the task please be clarified to avoid this misinterpretation. Alternatively, if all the other impementations are wrong, can the task please be clarified to avoid this misinterpretation :) --[[User:Jnd|Jnd]] ([[User talk:Jnd|talk]]) 10:20, 13 October 2014 (UTC)
Anonymous user