Questions tagged [non-procedure-application]

"application: not a procedure" is a common error in Scheme newbies code

"application: not a procedure" is a common error in Scheme newbies code.

See My code signals the error "application: not a procedure" or "call to non procedure" for a canonical Q&A.

7 questions
6
votes
1 answer

My code signals the error "application: not a procedure" or "call to non procedure"

During the execution of my code I get the following errors in the different Scheme implementations: Racket: application: not a procedure; expected a procedure that can be applied to arguments given: '(1 2 3) arguments...: Ikarus: Unhandled…
Sylwester
  • 47,942
  • 4
  • 47
  • 79
2
votes
1 answer

application: not a procedure mismatch error

I'm trying to implement a sort of read-write to cell function. (define (read-write-get cell) (cell (list))) (define (read-write-set cell x) (cell (list x))) (define (read-write-cell x) (let ((cell '())) (read-write-set cell x))) (define…
1
vote
0 answers

application: not a procedure drracket scheme

(define (layer li) (cond ((null? l) li) ((null? (cdr li)) (list (car li))) (else ((cons (list (car li)) (layer (cdr (li)))))))) This is my code above. I'm trying to run (layer '(1 2 3)) but I keep getting this error message below.…
aarondp987
  • 43
  • 4
0
votes
1 answer

Run length encoding of a list in scheme (R5RS)

(Question Details image -- describes RLE encoding) The (if ((equal? (car coins) (cadr coins))) piece of code in my rle function is not working, and the function stops working. (define (element-index lst element) (let loop ((counter 1) (temp…
NSK511
  • 1
  • 1
0
votes
1 answer

"application: not a procedure" while generating prime numbers

I am trying to output the first 100 prime numbers and keep getting the error: application: not a procedure; expected a procedure that can be applied to arguments given: (#) arguments...: [none] The error is shown in my take$ procedure here: (if…
-1
votes
1 answer

Scheme - application: not a procedure error

I'm coding a function in scheme but I'm getting a "application: not a procedure; expected a procedure that can be applied to arguments" error. I assume that I haven't used the conditional statements correctly: (define find-allocations (lambda (n…
user3352349
  • 177
  • 2
  • 4
  • 16
-1
votes
1 answer

"application: not a procedure" in determinant code

application: not a procedure; expected a procedure that can be applied to arguments given: 2 arguments...: -4 -6 12 -3 1 2 7 What does this error mean given the following code? (define (det2x2 a b c d)(- (* a d) (* b…
John Friedrich
  • 343
  • 5
  • 21