Skip to content

Features from pluck() #4

Description

@GregYannes

The Index() function is inspired by pluck() in the R language. Now pluck_exists() will test for existence, and pluck() itself will return a .default rather than throw an error:

# Test for existence...
pluck_exists(x, ...)

# ...and extract it (or default).
pluck(x, ..., .default = NULL)

Rather than throw an error, should our Index*() (and Arr_Index*()) families return a custom default like Null? And should we augment them with a convenience function like Index_Exists*() (and Arr_Exists*()?

Warning

Such a default argument would complicate the conversion (#2) of Arr_Index*() into a property. If it is present in the Get signature, it must be present in the Let/Set signatures—yet that is precisely where the value argument should go!

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions