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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T09:38:56+00:00 2026-06-03T09:38:56+00:00

I am thinking about learning Clojure, but coming from the c-syntax based (java, php,

  • 0

I am thinking about learning Clojure, but coming from the c-syntax based (java, php, c#) world of imperative languages that’s going to be a challenge, so one naturally asks oneself, is it really worth it? And while such question statement can be very subjective and hard to manage, there is one specific trait of Clojure (and more generally, the lisps) that I keep reading about, that is supposed to make it the most flexipowerful language ever: the macros.

Do you have any good examples of macro usage in Clojure, for purposes which in other mainstream languages (consider any of C++, PHP, Perl, Python, Groovy/Java, C#, JavaScript) would require much less elegant solutions/a lot of unnecessary abstraction/hacks/etc.

  • 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-03T09:38:57+00:00Added an answer on June 3, 2026 at 9:38 am

    there are a lot of macros in the base of clojure that you don’t think about… Which is a sign of a good macro, they let you extend the language in ways that make life easier. With out macros life would be much less exciting. for instance if we didn’t have

    (with-out-str (somebody else's code that prints to screen))
    

    then you would need to modify their code in ways that you may not have access to.

    another great example is

    (with-open-file [fh (open-a-file-code ...)]
       (do (stuff assured that the file won't leak)))
    

    the whole with-something-do pattern of macros have really added to the clojure eco system.


    the other side of the proverbial macro coin is that I spend essentially all of my (current) professional Clojure time using a very macro heavy library and thus i spend a lot of time working around the fact that macros don’t compose well and are not first class. The authors of this library are going to great lengths in the next version to make all the functionality available with out going through the macros to allow people like me to use them in higher order functions like map and reduce.

    macros improve the world when they make life easier. They can have the opposite effect when they are the only interface to a library. please don’t use macros as interfaces

    It is hard in general to get the shape of your data truly correct. If as a library author, you have the data structured well for how you envision your library being used it may very well be that there is a way to re-structure things to allow users to employ your library in new and unimaginable ways. In this case the structure of the fantastic library in question was really quite good, it allowed for things the authors had not intended. Unfortunatly a great library was restricted because it’s interface was a set of macros not a set of functions. the library was better than it’s macros, so they held it back. This is not to say that macros are in any way to blame, just that programming is hard and they are another tool that can have many effects and all the pieces must be used together to work well.

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

Sidebar

Related Questions

First of all, my ubiquitous language is PHP, and I'm thinking about learning Java.
As I am learning more about rails, and breaking my design thinking from ASP.Net
I'm thinking about learning ORM stuff but I think about one thing. If I
I'm learning how to code in Java after after coming from C. In C
I'm thinking about making an ad network as an experiment and for learning a
Thinking about a Windows-hosted build process that will periodically drop files to disk to
Thinking about avoiding code replication, I got a question that catches me every time
Currently thinking about pitching the argument for us migration from vs 2005 (winforms) to
I am thinking about learning assembly language in order to gain expertise in reverse
I've been thinking about learning Perl. Should I learn Perl5 or start with Perl6?

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.