I am using csv-reading
to read from a csv file to convert it into a list.
When I call at the top level, like this
> (call-with-input-file "to-be-asked.csv" csv->list)
I am able to read csv file and convert it into list of lists.
However, if I call the same thing within a function, I am getting the error.
> (read-from-file "to-be-asked.csv")
csv->list: undefined;
cannot reference an identifier before its definition
in module: top-level
I am not getting what's going wrong. I have added (require csv-reading)
before the function call.
My read-from-file
code is:
(define (read-from-file file-name)
(call-with-input-file file-name csv->list))
EDIT
I am using racket
within emacs
using Geiser
. When I (exit)
the buffer and type C-c C-z
, it is showing the error.
When I kill the buffer and start the Geiser
again, it is working properly.
Is it the mistake of Geiser
and emacs
?