We're updating the issue view to help you get more done. 

Supplied-p parameter in clojure

Description

As see in https://groups.google.com/forum/?hl=en#!topic/clojure/jWc51JOkvsA

I think we can add a ? option for destructure ,then we can write a test like :

1 2 3 4 5 6 7 8 9 10 (deftest supplied-p-in-destructuring (let [{:keys [a b c d] :p? {a a-p? b b-p? c c-p? d d-p?} :or {a 1}} {:b 2 :c 3 }] (is (= a 1)) (is (false? a-p?)) (is (= 2 b)) (is (true? b-p?)) (is (= 3 c)) (is (true? c-p?)) (is (nil? d)) (is (false? d-p?))))

Even if the a var has a default value 1 by :or option,but the a-p? is still false.
Just like the supplied-p-parameter in Commons LISP.

The patch is attached with code and test.

Environment

Mac OSX 10.9.4

java version "1.7.0_17"
Java(TM) SE Runtime Environment (build 1.7.0_17-b02)
Java HotSpot(TM) 64-Bit Server VM (build 23.7-b01, mixed mode)

Status

Assignee

Unassigned

Reporter

dennis zane

Labels

Approval

None

Patch

Code and Test

Affects versions

Release 1.7

Priority

Minor