KX Community

Find answers, ask questions, and connect with our KX Community around the world.

Home Forums KX Academy Variables in Fibanocci

  • Variables in Fibanocci

    Posted by roger on May 4, 2024 at 5:31 am

    What is not right about using the Y in the second formula? I considered it as a dummy variable (the first pair of x doesn’t matter because it’s a function within a function)

    pgyorok replied 1 week, 4 days ago 2 Members · 1 Reply
  • 1 Reply
  • pgyorok

    Member
    May 6, 2024 at 9:19 am

    The meaning of / depends on the arity of the function being modified. If it’s a unary function, that function gets called again and again passing in the result from one invocation as the argument to the next one.

    For a binary function, the meaning would be to apply the function between the accumulator and the next element in the input list – however in this case when you call the iterated function, you have to pass in an initial value and the list to iterate over. If you just pass in one argument, you create a projection.

Log in to reply.