Clojure

Extend cond to support inline let, much like for

Details

  • Type: Enhancement Enhancement
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Declined
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Patch:
    Code and Test

Description

I find it occasionally very useful to do a few tests in a cond, then introduce some new symbols (for both clarity and efficiency) that can be referenced in later tests (or matching expressions). This parallels similar functionality inside the for macro, where the :let keyword is matched against a vector of symbol bindings and forms an implicit let around the remainder of the comprehension.

I'll be adding a patch for this shortly.

Activity

Mark Engelberg made changes -
Field Original Value New Value
Assignee Mark Engelberg [ markengelberg ]
Mark Engelberg made changes -
Attachment cond-let-clauses.diff [ 11701 ]
Mark Engelberg made changes -
Priority Major [ 3 ]
Patch Code and Test [ 10002 ]
Mark Engelberg made changes -
Attachment cond-let-clauses-with-docstring.diff [ 11702 ]
Mark Engelberg made changes -
Attachment cond-let-clauses.diff [ 11701 ]
Mark Engelberg made changes -
Attachment cond-let-clauses-fixed-test.diff [ 11734 ]
Andy Fingerhut made changes -
Mark Engelberg made changes -
Attachment cond-let-clauses-fixed-test.diff [ 11734 ]
Mark Engelberg made changes -
Attachment cond-let-clauses-with-docstring.diff [ 11702 ]
Alex Miller made changes -
Fix Version/s Backlog [ 10035 ]
Andy Fingerhut made changes -
Rich Hickey made changes -
Status Open [ 1 ] Resolved [ 5 ]
Resolution Declined [ 2 ]

People

Vote (11)
Watch (5)

Dates

  • Created:
    Updated:
    Resolved: