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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T02:45:12+00:00 2026-05-22T02:45:12+00:00

I am working on a macro, I am trying to figure out how to

  • 0

I am working on a macro, I am trying to figure out how to avoid expansion of certain forms, take the following and macro for example,


(defmacro and
  ([] true)
  ([x] x)
  ([x & next]
   `(let [and# ~x]
      (if and# (and ~@next) and#))))

When expanded,

(mexpand-all '(and 1 2 3))

becomes,


(let* [and__973__auto__ 1]
      (if and__973__auto__
        (let* [and__973__auto__ 2]
              (if and__973__auto__ 3 and__973__auto__))
        and__973__auto__))

In this case what I need to do is stop let from expanding into let*.

  • 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-05-22T02:45:12+00:00Added an answer on May 22, 2026 at 2:45 am

    Recursive macro-expansion works by repeatedly expanding the form until there is no macro to expand. That means that if you want to recursively expand a macro, but ignore certain forms, you’ll have to either code your own custom expander, or find someone else’s.

    Here’s a quick example:

    (defn my-expander [form]
        (cond (not (list? form)) (mexpand-1 form)
            (= (first form) 'let) form
               :else (map my-expander (mexpand-1 form))))
    

    Please forgive me if I made any mistakes. I’m much stronger with Scheme and CL than Clojure.

    –Edit–
    Note that the above function will not expand the subforms of a let statement, either.

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

Sidebar

Related Questions

I'm trying to get Excel to figure out which columns of a worksheet are
It's a month I'm trying to figure out the best solution to my problem
I am working on a VSTO Excel 2010 Macro Enabled Template Project, that I
I am working on a helper macro that look into the list function on
hi i am working with c# and excel-2007... i wanted to add a macro
When creating my own macro, and trying to add it so that anyone can
I'm trying to debug and resolve some issues with a Win32 macro application written
I'm trying to load a file in a VBA macro that has been copied
I'm trying to set up autoconf for my project. I have everything working properly
I have a VBA macro for Microsoft Word that I am trying to improve.

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.