Hello-
I have been using Racket for about 18 months for personal projects and teaching. I have been doing all of my work in DrRacket but I wanted to interact with a module that I wrote on the interactive command line this morning. I am getting an error while using the command line that I am not getting in the Dr.Racket Interactions window.
This is the code that runs fine in the Interactions window of DrRacket:
(input-financial-data) deserializes the data properly and populates the list variable that I am using correctly. The lines of code in the module are:
...
(define data (input-financial-data data-file))
(printf "~a data records read~n" (length data))
(define closed-trades (filter trade-closed? data))
...
On the command line when running:
$> racket -i
...
> (enter! "year-1-analysis.rkt")
I get an error while trying to read a file of serialized structs. The error is:
given value instantiates a different structure type with the same name
expected: trade?
given: (trade #1=(date* 0 0 0 21 04 2017 3 294 #t -25200 0 "PDT") 'PYPL "simInvest" (list (transaction 29555578996 #1# "simInvest" 'PYPL 'BOUGHT 30 43.70) (transaction 29556891965 (date* 0 0 0 23 04 2017 3 294 #t -25200 0 "PDT") "simInvest" 'PYPL 'B...
My question is what are the differences between using a module in DrRacket versus on the command line? Thank you in advance for your assistance.
Cheers,
r..