Read file and store data into array

Discussion of Common Lisp
Post Reply
cossalter
Posts: 1
Joined: Mon Sep 27, 2010 11:26 am

Read file and store data into array

Post by cossalter » Mon Sep 27, 2010 11:42 am

Hello.

I'm trying to develop a code to read data from a txt file as follow:
3
2
2
3
2
2

So, I'd like to store these values into a array or something like that. I'm a lisp beginner!
The idea is to use each element of this array to draw lines.
For example:

for i = 0 : array.lengh
{
for j = 0: array[j]
{
draw line [j]
}
}

I don't know how to put or get values into array using lisp too.

ramarren
Posts: 613
Joined: Sun Jun 29, 2008 4:02 am
Location: Warsaw, Poland
Contact:

Re: Read file and store data into array

Post by ramarren » Mon Sep 27, 2010 11:55 am

You should read Practical Common Lisp which is a great book freely available online. I doubt that explaining the language at this level in a forum thread would be productive.

Post Reply