0
votes

I have function setup as

(define function (lambda (lst s1 s2 s3) ...... )))

when calling it - (function '(1 2 3) 0 0 0) - I am getting this error because of the ' ? What do I need to add into my code for it to understand the list " 1 2 3 " ? I have # lang racket at the top.. error below

‘: undefined; cannot reference an identifier before its definition

1

1 Answers

1
votes

It's quite possible that the quote ' character you're using is incorrect, this happens when you copy-paste code from a source with the wrong fonts. Try copying it again from the code below, it should work:

#lang racket

(define function
  (lambda (lst s1 s2 s3)
    'ok))

(function '(1 2 3) 0 0 0)
; => 'ok

If that doesn't work, then there's a problem with the actual body of the function, and you should add it to the question.