Dollar: Also support arrays wherever $ supports variadic parameters

Created on 14 Sep 2016  路  3Comments  路  Source: ankurp/Dollar

For example I cannot currently do this:

$.omit(myDictionary, keys: ["one", "two", "three"])

But must instead do this:

$.omit(myDictionary, keys: "one", "two", "three")

For lots of design paradigms (e.g. my blacklisted set of keys is shared and represented as an array, or I've derived the list of keys from an API and don't have them as individual values), this is frustrating.

This thread indicates that there is no language-specific way to pass an array into a variadic parameter. Thus I think $ should support this (the variadic versions can call into the array versions)

All 3 comments

Good idea. Will add.

awesome

+1

Was this page helpful?
0 / 5 - 0 ratings