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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:24:55+00:00 2026-06-16T07:24:55+00:00

I am new to macros. I am trying to write a macro to generate

  • 0

I am new to macros. I am trying to write a macro to generate some functions:

(defmacro test (name)
  `(defun ,(intern (concat "fun-" (symbol-name name))) ()
     ...))

I want to pass a symbol to this macro like (test 'stuff), but emacs gives me this error:

Debugger entered--Lisp error: (wrong-type-argument symbolp (quote stuff))

Is that telling me (quote staff) is not the right argument to symbol-name ? How can I fix this ?

  • 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-16T07:24:56+00:00Added an answer on June 16, 2026 at 7:24 am

    This all seems OK. The only thing is that you should call your macro with an unquoted symbol, like this:

    (test stuff)
    

    The reason for this is that, as noted in the Emacs Lisp Manual :

    Macros […] operate on the unevaluated expressions for the arguments, not on the argument values as functions do.

    When you pass symbols to functions, you are used to quote them to prevent them being considered as a variable name and evaluated to the associated value. However, macro arguments are not evaluated during the macro expansion, but afterwards, when the expansion itself gets evaluated.

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

Sidebar

Related Questions

I spent some time trying to write a 'helper' macro to test a parameter
I am new to VBA and trying to write a simple macro. I have
I'm trying to write some javascript in an environment where square brackets are used
I am trying to write a macro for an inventory DB. Where as when
I am trying to write a macro in VB for an Excel spreadsheet which
Just to understand how the Scheme macros work i'm trying to define a new
I'm trying to write a Word macro which inserts data from the Current User
I am trying to write some c# code to start a browser using Process.Start(app,args);
I've been trying to make a macro for 'wrapping' functions, i.e. if I have
I'm trying to write a simple visual studio 2010 macro to search the solution

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.