Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7164819
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T14:08:18+00:00 2026-05-28T14:08:18+00:00

I’m struggling to open a file, and read each line until EOF. I’m using

  • 0

I’m struggling to open a file, and read each line until EOF. I’m using nyquist, which is based on XLISP, and lacks Common Lisp’s with-open-file. My code is:

(let ((in_file (open "/home/soodesune/testfile.csv" :if-does-not-exist nil)))
    (loop for line = (read-line in_file)
         while line do (print line))
    (close in_file))

the output im getting from nyquist is:

error: unbound variable - LINE

I’d love some help understanding where I’m going wrong


Note:
I also tried:

(loop for line = (read-line in_file nil)

But that gives:

error: too many arguments

UPDATE:

Using the information and link that Rainer Joswig provided I was able to find typical code one might use to open a file and read it line by line:

  1 (do* ((fp (open "test.dat" :direction :input))
  2       (ex (read fp nil) (read fp nil)))
  3  ((null ex) (close fp) nil)
  4  (print ex))

The do function has three basic parts:

  1. lines 1 and 2 – variables assigned for use in the loop, their initial values and how to increment them. In this case fp and ex. fp is not incremented, and ex is initialized and incremented by one read from from fp (I have no idea what that trailing nil is for)
  2. line 3 – The exit condition for the loop, and a list of return expressions all of which are evaluated on exit, and the last of which is returned. In this case exit will occur when ex == null and then nil will be returned
  3. line 4 – The actual body of the loop. Self explanatory in this case.

note: do* differs from do in that it allows variables assigned in one expression to be used in a later one, like how fp is used in the assignment of ex

I’m a total n00b at any kind of LISP, so if any of the above is wrong, please speak up.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T14:08:19+00:00Added an answer on May 28, 2026 at 2:08 pm

    Nyquist is not based on Common Lisp. It is based on an early XLISP. It only supports a simple LOOP and not the complex LOOP of Common Lisp.

    See the Nyquist manual:

    http://www.cs.cmu.edu/~rbd/doc/nyquist/part19.html#226

    Its LOOP syntax is:

    (loop expr...)
    

    It does not support the extended LOOP syntax of Common Lisp.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We are using XSLT to translate a RIXML file to XML. Our RIXML contains
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have just tried to save a simple *.rtf file with some websites and
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
Basically, what I'm trying to create is a page of div tags, each has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I am reading a book about Javascript and jQuery and using one of the
I want use html5's new tag to play a wav file (currently only supported

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.