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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T20:36:33+00:00 2026-06-05T20:36:33+00:00

I want to get output like 0 1 , but the code below just

  • 0

I want to get output like 0 1, but the code below just print nil. I use type-of to test the (first hex), it is integer. %d should work, right? If I use message, it works in Emacs.

(defun draw-board (board)
  (loop for x below 2
        for hex = (aref board x)
        do (format "%d " (first hex))))

(draw-board [(0 2) (1 2) (0 3) (0 2)])
  • 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-05T20:36:35+00:00Added an answer on June 5, 2026 at 8:36 pm

    1- emacs lisp format is not Common Lisp format. Notice the missing
    argument!

    (format "%d" 42) == (cl:format NIL "~D" 42)
    

    2- therefore the only things your loop does are:

     - to check that board is a vector with at least two slots. (aref
       signals an error if the index is out of bound).
    
     - to check that each of those two slots are lists (first signals an
       error when passed a non list).
    
     - to check that the first element of each each of those two slots
       are numbers. (format signals an error when you pass a non number
       for %d).
    

    That’s all.

    You never said you wanted to print anything.

    To print something, you must put it in a buffer, and use
    ps-print-buffer:

    (defun draw-board (board)
      (with-temp-buffer
        (loop for x below 2
              for hex = (aref board x)
              do (insert (format "%d " (first hex))))
        (ps-print-buffer)))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to get output two bulleted lists like on the picture: But what
I want to get something like as shown in below and the code i
Consider the below String String names = Bharath-Vinayak-Harish-Punith I want to get output in
What I want: get a xml from the AppData to use What I code
When I type simple objects to Chrome JavaScript Console, I get an output like
In the below code i would like to also ignore the character . But
I want to generate a string like the one mentioned below in C# code
I use some code from the PHP manual to make an exception test, but
I have a variable which I get from database I want to output this
I want to be able to get some output from mysql stored procedure within

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.