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

  • Home
  • SEARCH
  • 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 4100580
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T20:35:08+00:00 2026-05-20T20:35:08+00:00

I am new at Lisp, and am trying different things out to improve my

  • 0

I am new at Lisp, and am trying different things out to improve my skills. I want to write a macro that wraps existing functions so that I can set up before and after forms for these functions, kind of like CLOS’s auxilliary methods or Elisp’s advice package. The trace function’s ability to wrap code dynamically has intrigued me, and it seems useful to be able to do this myself.

How can I do this?

Please note that I am using SBCL, and that, for the purposes of this question, I am not interested so much in the “right” way of doing this as I am in adding to my Lisp trick bag.

  • 1 1 Answer
  • 2 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-20T20:35:09+00:00Added an answer on May 20, 2026 at 8:35 pm

    I don’t know of any built-in support for this outside of CLOS. But you could just redefine the original function, like this:

    (defmacro add-post (fun-name &body body)
      (let ((orig (gensym)))
        `(let ((,orig (fdefinition ,fun-name))) 
           (setf (fdefinition ,fun-name) (lambda (&rest args)
                                           (apply ,orig args)
                                           ,@body)))))
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm new to lisp and trying to write a recursive function that returns minimum
I trying to complete this exercise; Write a Lisp function that takes as input
I was trying to write my own put-pixel on (Gdk) pixbuf in Lisp. When
I'm new to Common Lisp. I tried out the following do form: (do ((n
First, I am very new to lisp, so it is possible that I'm just
I'm trying to pick up Lisp as my new language, and I'm having some
Wracking my brain this afternoon trying to figure this one out. I'm fairly new
I'm completely new to lisp programming. I need to write a program for a
I'm new to Common Lisp, and found myself taking advantage of way functions returns
I'm very new to lisp and recently i discovered the thin that I don't

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.