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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T18:07:15+00:00 2026-06-11T18:07:15+00:00

I am writing a very simple lisp code for the recursive factorial function. When

  • 0

I am writing a very simple lisp code for the recursive factorial function. When called using a number, it works fine. However, when I try to call it using something that is not a number (ex. a) I get the following error:

Error: Attempt to take the value of the unbound variable `A’.
[condition type: UNBOUND-VARIABLE]

However, this is supposed to be caught in my code. Here is my code:

(defun FactorialRec (num)
   (cond                                                  
      ((not(numberp num))
         (princ "Argument must be a number.")
         (terpri)
         ())
      ((equal num 1) ;base case                                                       
         1)
      ((<= 1 num) (* num(FactorialRec (- num 1))))
   )
)

I do not know why the numberp is not catching this. Any ideas? Thanks.

  • 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-06-11T18:07:16+00:00Added an answer on June 11, 2026 at 6:07 pm
    Break 2 [6]> (FactorialRec "A")
    Argument must be a number.
    

    It works on my machine. So I think you were passing A but not "A"?

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

Sidebar

Related Questions

I am writing a very simple HTML code which is listed below. Written in
A very simple question: I am writing and running my R scripts using a
I am writing a code that I am sure is very simple, but for
I am writing a very simple template class using Metaprogramming to compute sum in
I'm writing a script to convert very simple function documentation to XML in python.
I'm currently writing a very simple game using python and pygame. It has stuff
Background I am writing and using a very simple CGI-based (Perl) content management tool
I'm writing very simple app. It works OK, but when I hit a back
I was writing a very simple piece of code given in the cuda by
I started writing a very Simple jQuery Popup myself. Here is the code <script

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.