Ad
  • Custom User Avatar

    This kata is a subject to deduplication process here: https://github.com/codewars/content-issues/issues/190.
    Please join the discussion to help us identify duplicate kata and retire them.

  • Custom User Avatar

    Fixed

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    nope. But you're searching for the "big foot", with the kind of keywords. ;)
    Since evaluation of a string may be done with recurcive parsing, I guess that's all you need to reach the recursion limit: 1001 numbers to pultiply means 1000 * operators, which in turn may mean (depending on the implementation) 1000 recursive calls (or evnen worse...)

  • Custom User Avatar

    Interesting.... so apparently eval is recursing somehow... do you happen to know of any online resources that might shine any more light on this? I searched on 'recursion errors without recursive functions' but didn't see anything about eval on SO.

    thanks

  • Custom User Avatar

    no, if you get a reccursion limit error, it's triggered be a recursion. It's coming from the guts of the implementation of eval, that's all. So it's still triggered by your code, even if it's not it that is recursive.

  • Custom User Avatar

    OK - so I guess I am learning something new here -
    I thought 'maximum recursion depth' errors only occur as consequence of excessive recursive function calls per se.
    Since my function does not call itself, there is no recursion - correct?
    If so, then I should deduce that something else can trigger this error, such as a large number of non-recursing function calls?
    Is this correct? If so, why is it not just giving a stack overflow error?

    Thanks in advance

    p.s. I have since solved it using a standard approach

  • Custom User Avatar

    read the message again, it tells explicitly that this error comes from that line of your code. So, guess what? surely it comes from the function you currently use in that line. ;)

    btw: don't use that... ;)

  • Custom User Avatar

    Random tests throw false recursion depth errors.

    My code has no recursion in it.

  • Default User Avatar

    Thank you for your kidness!

  • Custom User Avatar

    It collides with the name of the function you're writing ;-)

  • Default User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    Approved - unfortuantely it's a duplicate ;-)

  • Custom User Avatar

    Not really an issue.

  • Custom User Avatar

    Description updated.

  • Loading more items...