{"action":"created","issue":{"url":"https://api.github.com/repos/kevinlawler/kona/issues/397","labels_url":"https://api.github.com/repos/kevinlawler/kona/issues/397/labels{/name}","comments_url":"https://api.github.com/repos/kevinlawler/kona/issues/397/comments","events_url":"https://api.github.com/repos/kevinlawler/kona/issues/397/events","html_url":"https://github.com/kevinlawler/kona/issues/397","id":124654370,"number":397,"title":"getcsvFloat","user":{"login":"tavmem","id":1459367,"avatar_url":"https://avatars.githubusercontent.com/u/1459367?v=3","gravatar_id":"","url":"https://api.github.com/users/tavmem","html_url":"https://github.com/tavmem","followers_url":"https://api.github.com/users/tavmem/followers","following_url":"https://api.github.com/users/tavmem/following{/other_user}","gists_url":"https://api.github.com/users/tavmem/gists{/gist_id}","starred_url":"https://api.github.com/users/tavmem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tavmem/subscriptions","organizations_url":"https://api.github.com/users/tavmem/orgs","repos_url":"https://api.github.com/users/tavmem/repos","events_url":"https://api.github.com/users/tavmem/events{/privacy}","received_events_url":"https://api.github.com/users/tavmem/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kevinlawler/kona/labels/bug","name":"bug","color":"d7e102"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":10,"created_at":"2016-01-03T15:44:37Z","updated_at":"2016-01-06T20:20:00Z","closed_at":null,"body":"@dlorean00004 wrote:\r\n\r\nHi,\r\n\r\nthanks to your tip I am now able to compare results to K2.8. I am not sure if this is related to the above, but the following function works on K2.8. In kona I get a type error when calling the function, but when I run all its statements globally, I get the expected result.\r\ngetcsvFloat:{[filename;separator]\r\nf: { x@ & (#:' x) >0 }[ 0:filename ] ;\r\nreplacesep: {_ssr[x;y;\",\"]} ;\r\naddmissing:{s:\",\";:[(*x)=s;_f[\"0\",x];( * |x)=s;x,\"0\";x]} ;\r\ninsertmissing:{s:\",\";(x,(#x)#\"0\")@ < (!#x),& (x=s)&1!x=s} ;\r\nChartoFloat:{[dl;sep]. \": \",insertmissing addmissing  replacesep[dl;sep] } ;\r\n:{1. *' x }' ChartoFloat\\\\:[f;separator] ;\r\n}\r\nK2.8 :\r\n  getcsvFloat\\[\"testfile\";\";\"]\r\n(200 20.02 300 0 0 0\r\n 40 50 10 0 0 0.0)\r\n  \\cat testfile\r\n200;20.02;300;;0;\r\n40;50;10;;;\r\n\r\nKona:\r\n  getcsvFloat[\"testfile\";\";\"]\r\ntype error\r\n\r\nI think this can be reduced to:\r\ngetcsvFloat:{\r\nf:  \"200,20.02,0,8,9,0\"  ;\r\nconv:{ . \": \",x} ;\r\nconv[f] \r\n}\r\n\r\n  r:getcsvFloat[]\r\ntype error\r\n. \": \",x\r\n\\> \\\r\n f:  \"200,20.02,0,8,9,0\"  ;\r\n  conv:{ . \": \",x} ;\r\n  conv\\[f] \r\n(200;20.02;0;8;9;0)\r\n"},"comment":{"url":"https://api.github.com/repos/kevinlawler/kona/issues/comments/169449524","html_url":"https://github.com/kevinlawler/kona/issues/397#issuecomment-169449524","issue_url":"https://api.github.com/repos/kevinlawler/kona/issues/397","id":169449524,"user":{"login":"tavmem","id":1459367,"avatar_url":"https://avatars.githubusercontent.com/u/1459367?v=3","gravatar_id":"","url":"https://api.github.com/users/tavmem","html_url":"https://github.com/tavmem","followers_url":"https://api.github.com/users/tavmem/followers","following_url":"https://api.github.com/users/tavmem/following{/other_user}","gists_url":"https://api.github.com/users/tavmem/gists{/gist_id}","starred_url":"https://api.github.com/users/tavmem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tavmem/subscriptions","organizations_url":"https://api.github.com/users/tavmem/orgs","repos_url":"https://api.github.com/users/tavmem/repos","events_url":"https://api.github.com/users/tavmem/events{/privacy}","received_events_url":"https://api.github.com/users/tavmem/received_events","type":"User","site_admin":false},"created_at":"2016-01-06T20:20:00Z","updated_at":"2016-01-06T20:20:00Z","body":"Here is a surprise! \r\nThe above suggested a problem with \"each\".  That may not be the case. Consider the following:\r\n```\r\na0:{[f;s] \\t:{x@&(#:'x)>0}[0:f];               r:{_ssr[x;y;\",\"]}; r'[t;\";\"]}\r\na1:{[f;s] \\t:{x@&(#:'x)>0}[0:f];               r:{_ssr[x;y;\",\"]}; c:{[t;s]r[t;s]}; c'[t;\";\"]}\r\nb0:{[f;s] \\t:(\"200;20.02;300;;0;\";\"40;50;;;\"); r:{_ssr[x;y;\",\"]}; r'[t;\";\"]}\r\nb1:{[f;s] \\t:(\"200;20.02;300;;0;\";\"40;50;;;\"); r:{_ssr[x;y;\",\"]}; c:{[t;s]r[t;s]}; c'[t;\";\"]}\r\n```\r\nIn k2.8, all 4 functions produce the same correct result.  In Kona, the a1 result is wrong, but b1 is correct!\r\n```\r\na0[\"testfile\";\";\"]\r\n(\"200;20.02;300;;0;\"\r\n \"40;50;10;;;\")\r\n(\"200,20.02,300,,0,\"\r\n \"40,50,10,,,\")\r\n\r\na1[\"testfile\";\";\"]\r\n  (\"200;20.02;300;;0;\"\r\n \"40;50;10;;;\")\r\n((\"200;20.02;300;;0;\"\r\n  \";\")\r\n (\"40;50;10;;;\"\r\n  \";\"))\r\n\r\nb0[\"testfile\";\";\"]\r\n  (\"200;20.02;300;;0;\"\r\n \"40;50;10;;;\")\r\n(\"200,20.02,300,,0,\"\r\n \"40,50,10,,,\")\r\n\r\nb1[\"testfile\";\";\"]\r\n  (\"200;20.02;300;;0;\"\r\n \"40;50;10;;;\")\r\n(\"200,20.02,300,,0,\"\r\n \"40,50,10,,,\")\r\n```\r\nThe only difference between a1 & b1 is that in a1 the text is read from \"testfile\" into t.\r\nt is displayed by both functions, and looks identical in the display result of a1 and b1.\r\nBut t must be different in each case, or the final result of a1 & b1 should be the same.\r\n\r\nIt now seems that there may be a problem with 0: \r\nthat does not show up in the display of the result of 0:\r\nSounds unlikely, but that is what this exercise indicates !"}}