You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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!
The
Index()function is inspired bypluck()in the R language. Nowpluck_exists()will test for existence, andpluck()itself will return a.defaultrather than throw an error:Rather than throw an error, should our
Index*()(andArr_Index*()) families return a custom default likeNull? And should we augment them with a convenience function likeIndex_Exists*()(andArr_Exists*()?Warning
Such a
defaultargument would complicate the conversion (#2) ofArr_Index*()into a property. If it is present in theGetsignature, it must be present in theLet/Setsignatures—yet that is precisely where thevalueargument should go!