Open rebolbot opened 9 years ago
"I didn't know if exclude
modified its argument or not" - modifying functions must document the arguments they modify, see, e.g., help insert
.
See also add
, which does not modify either. The general naming rule Carl used was that all these functions shall use verbs as names.
I prefer to keep these functions/function names unchanged.
Submitted by: fork
I wanted to remove some items from a set, and realized I didn't know if EXCLUDE modified its argument or not. It sounds transitive, and transitive words like that tend to modify. Consider
But exclude does not modify:
If the word was EXCLUSION it wouldn't seem as odd. Or even more clear, EXCLUSION-OF.
INTERSECT has the same problem, and could similarly be solved with INTERSECTION or INTERSECTION-OF. Then INTERSECT could modify.
In trying to complete the set we'd wind up with:
INTERSECTION-OF, UNION-OF, EXCLUSION-OF, DIFFERENCE-OF
As parallels to their transitive forms:
INTERSECT, UNITE, EXCLUDE, DIFFERENTIATE (?)
However, differentiate sounds like Calculus, and I can't think of a better word. And really, having both sets is probably excessive.
The simplest solution would seem to be to make EXCLUDE the only verb form, and if you want a copying version make the copy yourself (as one has to do with INSERT and APPEND and other operations). Then just rename INTERSECT to INTERSECTION and call it done.
CC - Data [ Version: r3 master Type: Wish Platform: All Category: Unspecified Reproduce: Always Fixed-in:none ]