• Sign Up
  • Kata
  • Kumite
  • Blog
  • Forum
  • Wiki
  • Leaders
  • Log In
  • Sign Up
Name:Potato
Clan:HAW Hamburg
Member Since:Jul 2017
Last Seen:Sep 2020
Profiles:
Following:36
Followers:36
Allies:36
View Profile Badges
  • Stats
  • Kata
  • Collections
  • Kumite
  • Social
  • Discourse
  • Conversations (38)
  • Replies
  • Authored
  • Needs Resolution
    • ntwiles
    • commented on "Function-Factory" kata

    Might be good to specify that the function returned does not need to take any arguments.

    • doug97703
    • commented on "Char shuffle" kata

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

    • hobovsky
    • commented on "Function-Factory" kata

    Being able to return a function from inside of another function is a basic feature of functional programming paradigm, and it's not meant to be useful in any particular scenario. It's more of a builing block which can be used as a part of solutions to other problems. It's like with objects in object oriented programming: objects are not meant to fulfill some scenario, but you can build solutions to many scenarios with objects, as well as you can solve them without objects.

    This specific kata might serve as an example of working with so called "generators", or "suppliers", or however it's called in terms of functional programming. But it's totally up to you how, why and if you use such supplier, or not.

    • jonasmoeller
    • commented on "Function-Factory" kata

    Do you know in which kind of scenario something like this is useful?

    • jonasmoeller
    • commented on "Function-Factory" kata

    I know right?
    What sense does this have in a real world scenario?

    • jonasmoeller
    • commented on "Function-Factory" kata

    Oh ok now I understand :D

    • hobovsky
    • commented on "Function-Factory" kata

    You probably misunderstood the task, so please read description again. You should not return the result of operation. When tests call f = function_factory(2,3,'+'), expected result is not f equal to 5. Your solution should return a function, which, when called, will return 5:

    f = function_factory(2,3,'+')
    result = f( ) #this is where tests fail because you returned 5 and not a function
    print(result) #result should be equal to 5
    

    I have not seen your code but I guess your solution makes f equal to 5, and test fail when they want to call f( ) because 5 is not callable.

    • jonasmoeller
    • commented on "Function-Factory" kata

    Int not callable? i don't get it.

    • hman543
    • commented on "Function-Factory" kata

    Any hints? ahhh it must be easy.
    function functionFactory(x,y,operator){
    return (x operator y);
    }

    • Vimbi
    • commented on "Function-Factory" kata

    Why shove a function into a function? what is the meaning of the assignment?

    • steffan153
    • commented on "Function-Factory" kata

    The spoiler flag? So that you won't spoil it for people who haven't solved the kata.

    • gago94
    • commented on "Function-Factory" kata

    why I need that?

    • steffan153
    • created an issue for "Function-Factory" kata

    Crystal: https://www.codewars.com/kata/reviews/59648c0fac36dd258900099b/groups/5ea04669ee29ce00014fc20d

    • steffan153
    • commented on "Function-Factory" kata

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

    • gago94
    • commented on "Function-Factory" kata

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

  • Loading more items...
  • © 2021 Codewars
  • About
  • API
  • Blog
  • Privacy
  • Terms
  • Contact
  • powered by

Confirm

  • Cancel
  • Confirm