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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T11:26:59+00:00 2026-05-26T11:26:59+00:00

Lets say I want to use the threading operator to thread a map through

  • 0

Lets say I want to use the threading operator to thread a map through a series of function calls. All the functions take the map as a first parameter (good) but one function does not conform to the correct signature (say it takes the map as the last parameter). What is the best way to “fix” the function signature?

  • 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-26T11:27:00+00:00Added an answer on May 26, 2026 at 11:27 am

    The reader macro #() for anonymus functions is a good candidate here:

    (-> your-arg
      (fn1 arg2 arg3)
      (fn2 arg4 arg5)
      (#(fn3 arg6 arg7 %)) )
    

    It is flexible and adds little visual noise. You can of course do many different things, in this case partial function application would also work:

    (-> your-arg
      (fn1 arg2 arg3)
      ((partial fn2 arg4 arg5)))
    

    There is also the ->> macro which threads the first expression into the last position. Of course in your use case this doesn’t help much, as you would have to adjust some of the function calls. However if you are chaining many functions that should take the expression as the first argument and then many functions that take the expression as the last argument you could do something like

    (->>
      (-> your-arg
        (fn1 arg2 arg3)
        (fn2 arg5 arg6))
      (fn3 arg7 arg8)
      (fn4 arg10 arg11))
    

    EDIT: Added extra parenthesis in first example.

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

Sidebar

Related Questions

I want to use a timing function lets say kCAMediaTimingFunctionEaseInEaseOut My aim is I
Lets say you want to create a listing of widgets The Widget Manufacturers all
Lets say I have 4 images and I want to use these 4 images
Lets say I'm writing a some kind of conversion operator, and I want to
lets say I want to iterate through an array of doubles and sum them.
Lets say I want to map the following two classes: public class A {
I want to use the Separator control in a vertical way (Lets say in
Lets say I have two objects, and I want to use action script to
how do i use c# to run command prompt commands? Lets say i want
lets say that a user want to take vacation from 17-10-2010 to 15-11-2010. on

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.