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

People

Vote (0)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: