New to lisp and file IO
Posted: Thu Aug 23, 2012 11:57 pm
Hi all,
I am quite new to LISP and i am having a few problems reading from a file.
I'm not quite sure what LISP is capable of so maybe there is an easier way around this question but i am looking to create a list tree:
e.g. ((Emu)(Dog Beaver))
Firstly I read that lisp can read that straight from a file and make a list using defparameter.
So i have
1 - (defparameter *s* (open animals))
Then i get kinda lost.
2 - (read *s*) ???
anyways any help would be great.
so far my file animals has "((Emu)(Dog Beaver))" or would i have to have the animals in order and then read into the list?
Thanks
I am quite new to LISP and i am having a few problems reading from a file.
I'm not quite sure what LISP is capable of so maybe there is an easier way around this question but i am looking to create a list tree:
e.g. ((Emu)(Dog Beaver))
Firstly I read that lisp can read that straight from a file and make a list using defparameter.
So i have
1 - (defparameter *s* (open animals))
Then i get kinda lost.
2 - (read *s*) ???
anyways any help would be great.
so far my file animals has "((Emu)(Dog Beaver))" or would i have to have the animals in order and then read into the list?
Thanks