core.match

Allow flattened pattern syntax at top-level to avoid nesting :when and :as

Details

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

Description

On the Clojure mailing list I wrote:

For guards, I wonder if the extra parens are really necessary. Couldn't the :when bind tightly to the previous pattern variable? Like Clojure FOR comprehensions. I think it would be easier to read that way. Same comment applies to :as. To cover the rare case of matching a literal :when or :as, you could quote it or use it as the first item in an OR pattern.

On Oct 10, 2011, at 3:11 PM, David Nolen wrote:

It would be nice to lose the extra parens - patch welcome

  1. flat.patch
    12/Oct/11 10:28 AM
    4 kB
    Steve Miner
  2. flat2.patch
    14/Oct/11 1:03 PM
    5 kB
    Steve Miner
  3. flat3.patch
    15/Oct/11 7:59 AM
    6 kB
    Steve Miner
  4. flat4.patch
    20/Oct/11 3:04 PM
    6 kB
    Steve Miner

Activity

Steve Miner made changes -
Field Original Value New Value
Attachment flat2.patch [ 10394 ]
Steve Miner made changes -
Attachment flat3.patch [ 10396 ]
Steve Miner made changes -
Attachment flat4.patch [ 10492 ]
David Nolen made changes -
Status Open [ 1 ] Resolved [ 5 ]
Approval Ok [ 10007 ]
Resolution Completed [ 1 ]
Patch Accepted [ 10012 ]
Alex Miller made changes -
Patch Accepted [ 10012 ] Code and Test [ 10002 ]
David Nolen made changes -
Status Resolved [ 5 ] Closed [ 6 ]

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: