Uploaded image for project: 'Clojure'
  1. CLJ-1343

Add some?, when-some, if-some for (not (nil? x)) conditions

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Completed
    • Affects versions: Release 1.5
    • Fix versions: Release 1.6
    • Labels:
      None
    • Approval:
      Ok
    • Patch:
      Code and Test

      Description

      Sometimes it is useful to have a form for non-nil conditions (as opposed to the existing logical true conditions).
      Three additions to support this case:

      • some? - same as (not (nil? x))
      • if-some - like if-let, but checks (some? test) instead of test
      • when-some - like when-let, but checks (some? test) instead of test

      Patch: clj-1343-4.patch

        Attachments

        1. clj-1343-1.patch
          3 kB
        2. clj-1343-2.patch
          4 kB
        3. clj-1343-3.patch
          4 kB
        4. clj-1343-4.patch
          4 kB

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              alexmiller Alex Miller
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: