Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Newbie asking for help
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
The Glauber  
View profile  
 More options Jun 22 2000, 3:00 am
Newsgroups: comp.lang.lisp
From: The Glauber <theglau...@my-deja.com>
Date: 2000/06/22
Subject: Newbie asking for help
Allright... i've almost finished my second reading of Winston&Horn,
i've skimmed through some web-available tutorials, i'm a professional
programmer, i should be able to do this Lisp thing now, right? wrong.

I'm having trouble going from the tutorials to the real world. For
example, a lot of what i do is related to processing text files. So, i
though i'd write a simple/stupid program to count the number of lines
in a file. Here it is:

;; count number of lines in file key.html
(with-open-file (ifile "key.html" :direction :input)
                (setf nlines 0)
                (loop
                  (if (read-line ifile nil)
                    (setf nlines (+ 1 nlines))
                    (return nlines))))

It doesn't work (it just hangs, so i think it's stuck in the loop). I
thought it would read lines until the end of the file, when the read-
line would return nil, and that would trigger the second form inside
the if (a return, to get out of the loop).

I'm sorry for posting something so stupid, but why doesn't this work?

--
Glauber Ribeiro
theglau...@my-deja.com
"Opinions stated are my own and not representative of Experian"

Sent via Deja.com http://www.deja.com/
Before you buy.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.