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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T08:26:36+00:00 2026-05-26T08:26:36+00:00

We need parentheses here to make a call of anonymous function user=> (-> [1

  • 0

We need parentheses here to make a call of anonymous function

user=> (-> [1 2 3 4] (conj 5) (#(map inc %)))
(2 3 4 5 6)

Why there is no need for parentheses around map+ and fmap+ in these examples?

user=> (def map+ #(map inc %))
#'user/map+
user=> (-> [1 2 3 4] (conj 5) map+)
(2 3 4 5 6)

user=> (defn fmap+ [xs] (map inc xs))
#'user/fmap+
(-> [1 2 3 4] (conj 5) fmap+)
(2 3 4 5 6)
  • 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-26T08:26:36+00:00Added an answer on May 26, 2026 at 8:26 am

    The documentation for the -> and ->> macros state that the forms after the first parameter are wrapped into lists if they are not lists already. So the question is why does this not work for #() and (fn ..) forms? The reason is that both forms are in list form at the time the macro expands.

    For example

    (-> 3 (fn [x] (println x)))
    

    gets the (fn [x] ...) form at expansion time, so the macro thinks “great, it’s a list, I’ll just insert the 3 in the second position of the (fn ..) list.” Invoking macroexpansion, this is what we get:

    (fn 3 [x] (println x))
    

    which of course doesn’t work. Similarly for #():

    (-> 3 #(println %))
    

    is expanded to

    (fn* 3 [p1__6274#] (println p1__6274#))
    

    That’s why we need the extra parens.

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

Sidebar

Related Questions

I need to make a function which adds a function pointer to map. It
Need to call a filter function on some options based on a radio selected
I need a Regular Expression allowing user to input numbers, plus, minus and parentheses.
Need a function that takes a character as a parameter and returns true if
Need a function like: function isGoogleURL(url) { ... } that returns true iff URL
Need to insert selected text on the page into textarea. There must be some
I need to write a function par :: String -> Bool to verify if
Using GNU sed , I need to remove parenthetical phrases like (click here ....)
Greetings, Here is my problem. I need to get data from multiple rows and
I have the following sql command, i need to escape parentheses in PostgreSQL, how

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.