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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:30:57+00:00 2026-06-14T00:30:57+00:00

I am trying to get started with Lisp and I have some (messy) code

  • 0

I am trying to get started with Lisp and I have some (messy) code that i want to be able to ask the user for a title and url.

Save them in a variable, and then print them out when called. I am running into troubles though. First of all i don’t know how to compile my program to run it. Also, the one time when i did run it i got an error about the variable title being uncalled. Can anyone help me with either of these things? Sorry i can’t give you more information about the error.

;;Define a function called make-cd that takes four parameters
(defun make-url( title url ))
    (list :title title :url url)

;;In the make-url function create a plist that takes the passed values


;; Define global variable db and set its value to nil
(defvar *db* nil)

;; Define a function that takes one paramter and pushes it to the make-url func.
;;(defun add-url (url) (push url *db*))

;; Define a function that takes the *db* variable and makes the output pretty
(defun dump-db ()
   (dolist (url *db*)
       (format t "~{~a:~10t~a~%~}~%" url)))

(defun prompt-read (prompt)
  (format *query-io* "~a: " prompt)
  (force-output *query-io*)
  (read-line *query-io*))
  • 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-14T00:30:58+00:00Added an answer on June 14, 2026 at 12:30 am

    The code you have provided contains errors and will not compile. The error is in your definition of make-url. The proper definition should be:

    (defun make-url( title url )
          (list :title title :url url))

    Notice the difference in parenthesis placements.

    In your code you had an additional parenthesis following the parameter list. This closed the defun, causing make-url to be evaluated as a function with no body. The next line was then evaluated as a call to the built-in function list. The arguments were evaluated, and an error was encountered when it attempted to find a value for title. There is no binding in the global environment, a binding for title only exists within the body of make-url.

    Also, your definition of add-url is commented out. A semi-colon begins a comment in Lisp.

    How to compile and run your program depends on what compiler you are using. If you are using SBCL the function is sb-ext:save-lisp-and-die. A simple program like this would usually be run in a Read-Eval-Print-Loop(REPL), and most compilers will enter one when started. If you have SBCL installed you can start a repl by entering the command ‘SBCL’ to the command prompt. If your code is in an external file you can then load that using Load.

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

Sidebar

Related Questions

I am trying to get started with scons . I have Python 3.0.1 and
i'm trying to get started with silverlight 2. i have a weird bug. every
I am trying to get started doing some Silverlight development. I am interested in
I'm trying to get started using agsXMPP , but I'm having some problems. I'm
I am trying to get started with unit testing an app that uses Core
Trying to get started with subsonic but have a simple question about stored procedures
I trying to get started with Google Perf Tools to profile some CPU intensive
I'm trying to get started using git, but I'm having some troubles right away.
I am trying to get started with pic24's, specifically the PIC24FJ64GA002, and I have
I'm trying to get started with Hibernate, but can't insert data, for some reason.

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.