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

Alex Miller made changes -
Field Original Value New Value
Approval Vetted [ 10003 ]
Attachment clj-1343-1.patch [ 12768 ]
Fix Version/s Release 1.6 [ 10157 ]
Stuart Halloway made changes -
Resolution Completed [ 1 ]
Status Open [ 1 ] Closed [ 6 ]
Alex Miller made changes -
Approval Vetted [ 10003 ] Screened [ 10004 ]
Status Closed [ 6 ] Reopened [ 4 ]
Resolution Completed [ 1 ]
Rich Hickey made changes -
Approval Screened [ 10004 ] Incomplete [ 10006 ]
Alex Miller made changes -
Approval Incomplete [ 10006 ] Vetted [ 10003 ]
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 - same as (if (some? test) then else)
* when-some - same as (when (some? test) body)
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-2.patch
Attachment clj-1343-2.patch [ 12784 ]
Stuart Halloway made changes -
Approval Vetted [ 10003 ] Screened [ 10004 ]
Alex Miller made changes -
Attachment clj-1343-3.patch [ 12789 ]
Alex Miller made changes -
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-2.patch
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-3.patch
Rich Hickey made changes -
Approval Screened [ 10004 ] Incomplete [ 10006 ]
Stuart Halloway made changes -
Approval Incomplete [ 10006 ] Screened [ 10004 ]
Rich Hickey made changes -
Approval Screened [ 10004 ] Incomplete [ 10006 ]
Alex Miller made changes -
Approval Incomplete [ 10006 ] Vetted [ 10003 ]
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-3.patch
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
Attachment clj-1343-4.patch [ 12790 ]
Rich Hickey made changes -
Approval Vetted [ 10003 ] Ok [ 10007 ]
Stuart Halloway made changes -
Resolution Completed [ 1 ]
Status Reopened [ 4 ] Closed [ 6 ]

People

Vote (0)
Watch (3)

Dates

  • Created:
    Updated:
    Resolved: