You are writing a genetic program. You have your population stored in a file, each member of your population is represented as a list. You want a way to pass all of that data to the function run-genetic-programming-system. As things are currently set up run-genetic-programming-system takes a symbol (name of a fitness function?), a random number, some other number (number of generations to run for?) and the population as a &rest argument. Presumably your code either returns the new population perhaps sorted by fitness (good) or writes that new population to a file (less good).
You can slurp up an entire file like Ramarren showed (using iterate):
Code: Select all
(iter (for list in-file file)
(collect (second list)) )
Code: Select all
(with-open-file (stream file)
(apply #'run-genetic-programming-system
'area-circle (random 100.0) 10000
(iter (for list in-file file)
(collect (second list)) )))
Code: Select all
(with-open-file (stream file)
(run-genetic-programming-system
'area-circle (random 100.0) 10000
(iter (for list in-file file)
(collect (second list)) )))