Talk:Hash from two arrays: Difference between revisions

From Rosetta Code
Content added Content deleted
(→‎Intent: new section)
Line 7: Line 7:


:I replaced the one-liner with an if statement. --[[User:Short Circuit|Short Circuit]] 10:02, 25 January 2007 (EST)
:I replaced the one-liner with an if statement. --[[User:Short Circuit|Short Circuit]] 10:02, 25 January 2007 (EST)

== Intent ==

What exactly is the intent behind this task? It seems to specify the creation of a mapping of elements from one set to another, but what of the consequences of the hash requirement? Is the mapping supposed to be lossy, in the sense that not all values will have a key in the map in the end?

I think the task needs to be clarified, perhaps with an additional or optional requirement to "prove" the validity of the code by providing input data and matching against an output state. But I'm not sure what the relationship between input and output is supposed to be. --[[User:Short Circuit|Short Circuit]] 03:11, 8 May 2009 (UTC)

Revision as of 03:11, 8 May 2009

C#

//I added this to just have some basic error checking
int arg_length = arg_keys.Length == arg_values.Length ? arg_keys.Length : 0;

I'm not really sure such an absolutely not-understandable line should be on this repository, as most of the users won't even understand it. At the very least, there should be some sort of comment, or just change it and do it on a few lines instead of hashing the source code itself. --CrashandDie 09:42, 25 January 2007 (EST)

I replaced the one-liner with an if statement. --Short Circuit 10:02, 25 January 2007 (EST)

Intent

What exactly is the intent behind this task? It seems to specify the creation of a mapping of elements from one set to another, but what of the consequences of the hash requirement? Is the mapping supposed to be lossy, in the sense that not all values will have a key in the map in the end?

I think the task needs to be clarified, perhaps with an additional or optional requirement to "prove" the validity of the code by providing input data and matching against an output state. But I'm not sure what the relationship between input and output is supposed to be. --Short Circuit 03:11, 8 May 2009 (UTC)