Clojure

Extend cond to support inline let, much like for

Details

  • Type: Enhancement Enhancement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • 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 -
Patch Code and Test [ 10002 ]
Priority Major [ 3 ]
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 -

People

Vote (2)
Watch (3)

Dates

  • Created:
    Updated: