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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:37:48+00:00 2026-05-31T07:37:48+00:00

Note Learning Lisp I am getting this error: Illegal argument in functor position: (EVALEXP

  • 0

Note Learning Lisp

I am getting this error:

Illegal argument in functor position: (EVALEXP (CDR MAIN-LIST) BIND-LIST) 
in ((EVALEXP(CDR   MAIN-LIST) BIND-LIST))

from this:

(defun evalexp (main-list bind-list)

(if (eq nil (cdr main-list)) 
    (  (if  (eq nil  (atom (car main-list))) (evalexp (car main-list) bind-list) ) )

( (print (car main-list))
  (evalexp (cdr main-list) bind-list) )
)

main-list contains this list:

(and 1 (or a b))

What is in bind-list doesn’t matter because I am not using it yet. I am trying to loop through the list printing out each car. Any ideas why I am getting this error?

  • 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-31T07:37:50+00:00Added an answer on May 31, 2026 at 7:37 am

    Extra parentheses.

    Normally the first thing after an opening parenthesis is a function name. You have another opening parenthesis there in some cases, which is a syntax error, as you saw.

    You also seem to want a statement block. progn often fits the bill. You could use a block for the inner if, but it’s really not necessary since it would contain only one statement.

    (defun evalexp (main-list bind-list)
      (if (eq nil (cdr main-list)) 
          (if  (eq nil (atom (car main-list))) (evalexp (car main-list) bind-list) )
          (progn
            (print (car main-list))
            (evalexp (cdr main-list) bind-list) )
      )
    )
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

(Note: I'm writing this project for learning only; comments about it being redundant are...
Note: This was posted when I was starting out C#. With 2014 knowledge, I
Note: Originally this question was asked for PostgreSQL, however, the answer applies to almost
Note : The code in this question is part of deSleeper if you want
(Note: This is for MySQL's SQL, not SQL Server.) I have a database column
Note This is not a REBOL-specific question. You can answer it in any language.
I'm interest in learning how to use jquery comet to create real-time multi-user note
I am learning GAE and am getting a bit stuck. If I use the
I'm finally learning regexps and training with ack . I believe this uses Perl
I am learning WCF and right now I am getting one exception while running

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.