Skip to content

Clarify if indentation #229

Open
Open
@gpind

Description

@gpind

By my reading of https://github.com/bbatsov/clojure-style-guide#vertically-align-fn-args, we should indent if like so:

(if condition
    (f1)
    (f2))

...but that's contradicted by other examples in the guide, which use the common two-space indentation for if. Technically the rule might not cover if since it's a special form and not a macro, but there's also if-let and if-some and it would be very weird IMO to indent them differently. It would be good to mention this explicitly, even if just to call out if and friends as exceptions.

(I searched for existing issues covering this, but the closest I found was #87.)

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy