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 6598563
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T18:21:58+00:00 2026-05-25T18:21:58+00:00

The following code will raise: SYSTEM::%EXPAND-FORM: (SETQ NUM (SUBSTRING LINE 6)) should be a

  • 0

The following code will raise: SYSTEM::%EXPAND-FORM: (SETQ NUM (SUBSTRING LINE 6)) should be a lambda expression.

(defun good-red ()
  (let ((tab (make-hash-table)))
    (dotimes (i 50) (setf (gethash (+ i 1) tab) 0))
    (with-open-file (stream "ssqHitNum.txt")
        (loop for line = (read-line stream nil)
             until (null line)
             do (
                (setq num (substring line 6))
                (print line)
                )))))

If i change the “do” as below, it works. However, i need to do many things here.

 ...
 do (print line)
 ...

Sincerely!

  • 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-25T18:21:59+00:00Added an answer on May 25, 2026 at 6:21 pm

    You need to remove the outermost set of parens like this.

    (loop for line = (read-line stream nil)
             until (null line)
             do 
                (setq num (substring line 6))
                (print line))
    

    The loop body has an implicit progn around it, when you add the extra parens the reader will expect the first thing in the list (in this case (setq num (substring line 6)) to be a symbol with a function. Obviously the setq form does not meet that criteria and so it will fail, though I’m not sure why it tells you it should be a lambda expression.

    A style note:

    Do not use parens as you would curly braces in Java or C++!

    do (
         &body
       )
    

    is bad Lisp style, close all parens on the last line as I have in my answer and open parens on the same line as the form the left paren begins.

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

Sidebar

Related Questions

The following code will generate a link to the page I want to get
The following code will not run correctly in IE7 with the latest service packs
The following code will search for the user within the domain controller, but I
The following code will add the categories selector widget to the WordPress Page editor
The following code will log in my application to a server. That server will
I have following code in my Application. Comments in my code will specify My
What will the following code print? print ‘’four’’ * 200;
Will the following code result in a deadlock using C# on .NET? class MyClass
I have the following code, which will not work. The javascript gives no errors
I have the following code, which will retrieve a filename from a table and

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.