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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T16:34:30+00:00 2026-05-22T16:34:30+00:00

Is the -> operator in Clojure (and what is this operator called in Clojure-speak?)

  • 0

Is the -> operator in Clojure (and what is this operator called in Clojure-speak?) equivalent to the pipeline operator |> in F#? If so, why does it need such a complex macro definition, when (|>) is just defined as

let inline (|>) x f = f x

Or if not, does F#’s pipeline operator exist in Clojure, or how would you define such an operator in Clojure?

  • 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-22T16:34:30+00:00Added an answer on May 22, 2026 at 4:34 pm

    No, they are not the same. Clojure doesn’t really have a need for |> because all function calls are enclosed in lists, like (+ 1 2): there’s no magic you could do to make 1 + 2 work in isolation.1

    -> is for reducing nesting and simplifying common patterns. For example:

    (-> x (assoc :name "ted") (dissoc :size) (keys))
    

    Expands to

    (keys (dissoc (assoc x :name "ted") :size))
    

    The former is often easier to read, because conceptually you’re performing a series of operations on x; the former code is “shaped” that way, while the latter needs some mental unraveling to work out.

    1 You can write a macro that sorta makes this work. The idea is to wrap your macro around the entire source tree that you want to transform, and let it look for |> symbols; it can then transform the source into the shape you want. Hiredman has made it possible to write code in a very Haskell-looking way, with his functional package.

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

Sidebar

Related Questions

How does the comma operator work in C++? For instance, if I do: a
Why does the sizeof operator return a size larger for a structure than the
Why does delete operator return true if I try to delete non existing indexed
Does the is operator indicate whether or not an object is an instance of
Complex operator*(double m, const Complex & c) { return c * m; } *On
What is the operator int function below? What does it do? class INT {
i have an overloaded operator << trying to make it work like this mystream<<hex<<10;
Clojure has a -> macro which inserts each expression recursively as the first argument
What does the |= operator mean in C++?
I've seen this operator pop up quite a few times in example code in

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.