plai

“application: not a procedure” in binary arithmetic procedures

浪子不回头ぞ 提交于 2019-11-26 11:25:48
I have a simple Racket definition for multiplying binary numbers together. It uses a well-tested "addWithCarry" definition that takes three parameters: two lists and a carry digit and returns the binary sum. The binary numbers are represented as lists in reverse order. I stepped through the test line with the debugger, and it goes through the recursion properly. It performs the multBins each time shrinking the y list as appropriate, then conducts the addWithCarry functions as expected. As it rises back up the stack, it suddenly throws an exception "application: not a procedure, expected a

“application: not a procedure” in binary arithmetic procedures

五迷三道 提交于 2019-11-26 02:25:44
问题 I have a simple Racket definition for multiplying binary numbers together. It uses a well-tested \"addWithCarry\" definition that takes three parameters: two lists and a carry digit and returns the binary sum. The binary numbers are represented as lists in reverse order. I stepped through the test line with the debugger, and it goes through the recursion properly. It performs the multBins each time shrinking the y list as appropriate, then conducts the addWithCarry functions as expected. As