“application: not a procedure” while computing binomial

后端 未结 3 1319

I am defining a function binomial(n k) (aka Pascal\'s triangle) but am getting an error:

    application: not a procedure;
    expected a procedure          


        
3条回答
  •  感动是毒
    2021-01-26 15:49

    Your error is here:

    binomial(n)
    

    n is an integer, not a function. If you put parentheses around it like that, scheme tries to invoke an integer as a function, which naturally produces an error.

提交回复
热议问题