Hari Chaudhary
Hari Chaudhary

Reputation: 650

calling procedure in Scheme using Dr. Racket

I have this code in Scheme:

(define (calculate-mark MidTerm FinalExam Assignment Clicker)
(lambda(MidTermWeight) (/(* 3 MidTerm)10)
  (display MidTermWeight))
 )

Now when I calling this function by:

(calculate-mark 10 10 10 10)

It is showing this:

#<procedure>

Why it is not displaying any result?

Upvotes: 1

Views: 221

Answers (1)

daniel gratzer
daniel gratzer

Reputation: 53871

In Scheme, you can define a function like this

 (define (foo bar)
    ...)

or

  (define foo
     (lambda (bar)
         ...))

But you've done both so you're procedure returns another procedure: (lambda (midtermWeight).... You'll have to call it again with the midtermweight to get a result.

Upvotes: 4

Related Questions