Hey,
I want to index a nested array. It works fine for some of my data, but sometimes I get the error from the title.
The string it complains on (which is an array key):
Ask Questions\n\nJoin the discussion...\n\n \n\nRichard Wigley\n\nI'm confused about the calling of the length recursion base case: so 'defp length ], count)' vs 'defp\nlength([_|t], count)' and | am assuming that Elixir pattern matches the 'defp length([ J, count)' function when\nthe list is empty and pattern matches 'defp length([_]t], count)' when it has an element? I'm throwing in the\nterm 'pattern matching' here but I don't understand it as | am used to functions matching on argument type.\n1 a _ v- Reply - Share\n\nDaniel Berkompas ~» Richard Wigley\n\n& Elixir is different from many programming languages in how it decides which version of a function to\ncall. It calls the first version of a function where the arguments _match_ the pattern in the function\ndefinition. This allows you to be much more specific than a statically typed language. For example, as\nshown in this episode, you can run a given function definition only in the case where the list is empty.\n\nI talk more about this in the previous episode on Control Flow. https://www.learnelixirtw/epi...\n1 m ~ > Reply - Share:
Some additional info from the error:
type: illegal_argument_exception
reason: failed to parse
root_cause: [%{reason: "failed to parse", type: "mapper_parsing_exception"}]
status: 400
I am not sure what's wrong. I mean, it's just a string.