Clojure

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

Details

  • Type: Enhancement Enhancement
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Completed
  • Affects Version/s: Release 1.5
  • Fix Version/s: Release 1.6
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code and Test
  • Approval:
    Ok

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

  1. clj-1343-1.patch
    07/Feb/14 11:21 AM
    3 kB
    Alex Miller
  2. clj-1343-2.patch
    12/Feb/14 12:38 PM
    4 kB
    Alex Miller
  3. clj-1343-3.patch
    14/Feb/14 10:01 AM
    4 kB
    Alex Miller
  4. clj-1343-4.patch
    14/Feb/14 10:39 AM
    4 kB
    Alex Miller

Activity

People

Vote (0)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: