Difference between revisions of "Naming conventions"
(6 intermediate revisions by one other user not shown) | |||
Line 88: | Line 88: | ||
|- | |- | ||
<!-- chunks --> | <!-- chunks --> | ||
− | |'''chunks''' ||chunked || | + | |'''chunks''' ||chunked ||chunk / chunkify ||chunker ||byChunk / asChunks || |
|- | |- | ||
<!-- enumerate --> | <!-- enumerate --> | ||
|enumeration ||enumerated ||'''enumerate''' ||enumerator || || | |enumeration ||enumerated ||'''enumerate''' ||enumerator || || | ||
+ | |- | ||
+ | ! colspan="6" | std.range (new in 2.068) | ||
+ | |- | ||
+ | <!-- choose --> | ||
+ | |choice ||chosen ||'''choose''' ||chooser || || | ||
+ | |- | ||
+ | <!-- chooseAmong --> | ||
+ | |choiceAmong ||chosenAmong ||'''chooseAmong''' ||chooserAmong || || | ||
+ | |- | ||
+ | <!-- generate --> | ||
+ | |generation ||generated ||'''generate''' ||generator || || | ||
+ | |- | ||
+ | <!-- merge --> | ||
+ | |'''merge''' ||merged ||'''merge''' ||merger || || | ||
|- | |- | ||
! colspan="6" | std.algorithm | ! colspan="6" | std.algorithm | ||
Line 169: | Line 183: | ||
|'''setUnion''' ||unionized ||setUnion ||setUnionizer || ||[http://english.stackexchange.com/questions/150843/verb-for-to-form-the-union-of-a-and-b union (verb)] | |'''setUnion''' ||unionized ||setUnion ||setUnionizer || ||[http://english.stackexchange.com/questions/150843/verb-for-to-form-the-union-of-a-and-b union (verb)] | ||
|- | |- | ||
− | ! colspan="6" | std.path | + | ! colspan="6" | std.path (new in 2.068) |
|- | |- | ||
<!-- setExt --> | <!-- setExt --> | ||
− | | ||extChanged ||'''setExt''' | + | | ||extChanged ||'''setExt''', <s>setExtension</s>||extensionSetter ||withExtension || |
|- | |- | ||
− | ! colspan="6" | std.uni | + | <!-- defaultExt --> |
+ | |'''defaultExt''', <s>defaultExtension</s>||defaultExtChanged||setDefaultExtension||defaultExtensionSetter||withDefaultExtension|| | ||
+ | |- | ||
+ | <!-- chainPath --> | ||
+ | |chainedPath ||chainedPath ||'''chainPath''', <s>buildPath</s>||pathBuilder|| || | ||
+ | |- | ||
+ | <!-- toAbsolutePath --> | ||
+ | |<s>absolutePath</s> || ||makeAbsolutePath ||absolutePathBuilder, pathAbsolutizer||'''toAbsolutePath''', asAbsolutePath|| | ||
+ | |- | ||
+ | <!-- toNormalizedPath --> | ||
+ | |<s>normalizedPath</s> || ||makeNormalizedPath ||normalizedPathBuilder, pathNormalizer||'''toNormalizedPath''', asNormalizedPath|| | ||
+ | |- | ||
+ | <!-- toRelativePath --> | ||
+ | |<s>relativePath</s> || ||makeRelativePath ||relativePathBuilder, pathRelativizer||'''toRelativePath''', asRelativePath|| | ||
+ | |- | ||
+ | ! colspan="6" | std.uni (new in 2.068) | ||
|- | |- | ||
<!-- toLowerCase --> | <!-- toLowerCase --> | ||
− | | | + | |lowerCaseString ||lowerCased ||lowerCase ||lowerCaser ||'''toLowerCase''', asLowerCase|| |
|- | |- | ||
<!-- toUpperCase --> | <!-- toUpperCase --> | ||
− | | | + | |upperCaseString ||upperCased ||upperCase ||upperCaser ||'''toUpperCase''', asUpperCase|| |
|- | |- | ||
<!-- toCapitalized --> | <!-- toCapitalized --> | ||
|capitalization ||capitalized ||<s>capitalize</s> ||capitalizer ||'''toCapitalized''', asCapitalized|| | |capitalization ||capitalized ||<s>capitalize</s> ||capitalizer ||'''toCapitalized''', asCapitalized|| | ||
+ | |- | ||
+ | ! colspan="6" | std.string (new in 2.068) | ||
+ | |- | ||
+ | <!-- entabber --> | ||
+ | | ||entabbed ||<s>entab</s> ||'''entabber''' || || | ||
+ | |- | ||
+ | <!-- detabber --> | ||
+ | | ||detabbed ||<s>detab</s> ||'''detabber''' || || | ||
+ | |- | ||
+ | <!-- leftJustifier --> | ||
+ | |leftJustification ||leftJustified ||<s>leftJustify</s> ||'''leftJustifier''' || || | ||
+ | |- | ||
+ | <!-- rightJustifier --> | ||
+ | |rightJustification ||rightJustified ||<s>rightJustify</s> ||'''rightJustifier''' || || | ||
+ | |- | ||
+ | <!-- centerJustifier --> | ||
+ | |centerJustification ||centerJustified ||centerJustify ||'''centerJustifier''' || || | ||
+ | |- | ||
+ | <!-- soundexer --> | ||
+ | |<s>soundex</s> ||soundexed ||<s>soundex</s> ||'''soundexer''' || || | ||
<!-- | <!-- | ||
|- | |- | ||
Line 195: | Line 244: | ||
--> | --> | ||
|} | |} | ||
+ | |||
+ | |||
+ | [[Category: Contribution Guidelines]] |
Latest revision as of 20:07, 8 September 2015
Schemes
I could identify the following distinct naming schemes:
Name | Example | Template |
---|---|---|
result-noun | chunks | This function returns its argument(s) as/in (a) _____ This function returns the _____ of its argument(s) The function's return value is a _____ of its argument |
result-adjective | chunked | This function's return value is its argument(s) but _____ This function's return value is _____ compared to its argument(s) |
verb | chunk / chunkify | This function's goal is to _____ its argument(s) |
verb-noun | chunker | This function is a(n) _____ |
preposition+noun/adj. | byChunk / asChunks | This function's return value presents the argument _____ |
Existing names
Here are some lazy functions in Phobos which operate on (take and return) ranges, their existing names (in bold), and what their name might look like in the above naming schemes. Names already in use by other parts in Phobos are struck out.
Feel free to edit this table if you have any brilliant ideas, but just to clarify - these are informative, and no renaming of existing, established names is being considered.
result-noun | result-adjective | verb | verb-noun | preposition+noun/adj. | other |
---|---|---|---|---|---|
std.range | |||||
reversed | reverser | inReverse | retro | ||
stride | stridden | stride | strider | withStride | |
chain | chained | chain | chainer | asChain | |
roundRobin | inRoundRobin | ||||
radialOrder | radial | radialArrange | radialArranger | inRadialOrder | |
prefix | taken | take | taker | withLength | |
exactPrefix | exactTaken | takeExactly | exactTaker | withExactLength | |
singlePrefix | oneTaken | takeOne | oneTaker | withLengthOne | |
noPrefix | noneTaken | takeNone | noneTaker | asEmpty | |
suffix | dropped | drop | dropper | withDropped | |
exactSuffix | exactDropped | dropExactly | exactDropper | withExactDropped | |
singleSuffix | oneDropped | dropOne | oneDropper | withOneDropped | |
repeat | repeated | repeat | repeater | ||
cycle | cycled | cycle | cycler | ||
zipped | zip | zipper | |||
lockstep | lockIterate | lockIterator | inLockstep | ||
transversal | transversed | transverse | transverser | asTransversal | |
frontTransversal | frontTransversed | transverseFront | frontTransverser | ||
transposition | transposed | transpose | transposer | ||
indexed | index | indexer | withIndex | ||
chunks | chunked | chunk / chunkify | chunker | byChunk / asChunks | |
enumeration | enumerated | enumerate | enumerator | ||
std.range (new in 2.068) | |||||
choice | chosen | choose | chooser | ||
choiceAmong | chosenAmong | chooseAmong | chooserAmong | ||
generation | generated | generate | generator | ||
merge | merged | merge | merger | ||
std.algorithm | |||||
commonPrefix | getCommonPrefix | ||||
find | finder | ||||
findAdjacent | adjacentFinder | ||||
findAmong | |||||
until | |||||
mismatch | getMismatch | ||||
cache | cached | cache | cacher | withCache | |
cacheBidirectional | bidirectionalCached | cacheBidirectional | bidirectionalCacher | withBidirectionalCache | |
chunkedBy | chunkBy | chunkerBy | |||
filter | filtered | filter | filterer | withFilter | |
filterBidirectional | filteredBidirectional | filterBidirectional | bidirectionalFilterer | withBidirectionalFilter | |
group | grouped | group | grouper | asGroup | |
joined | joiner | ||||
map | mapped | map | mapper | ||
reduction | reduced | reduce | reducer | ||
splitter | |||||
unique | uniq | ||||
cartesianProduct | crossJoined | crossJoin | crossJoiner | ||
nWayUnion | |||||
setDifference | subtracted | setSubtract | setDifferentiator | ||
setIntersection | intersected | setIntersect | setIntersecter | ||
setSymmetricDifference | symmetricSubtracted | setSymmetricSubtract | setSymmetricDifferentiator | ||
setUnion | unionized | setUnion | setUnionizer | union (verb) | |
std.path (new in 2.068) | |||||
extChanged | setExt, |
extensionSetter | withExtension | ||
defaultExt, |
defaultExtChanged | setDefaultExtension | defaultExtensionSetter | withDefaultExtension | |
chainedPath | chainedPath | chainPath, |
pathBuilder | ||
makeAbsolutePath | absolutePathBuilder, pathAbsolutizer | toAbsolutePath, asAbsolutePath | |||
makeNormalizedPath | normalizedPathBuilder, pathNormalizer | toNormalizedPath, asNormalizedPath | |||
makeRelativePath | relativePathBuilder, pathRelativizer | toRelativePath, asRelativePath | |||
std.uni (new in 2.068) | |||||
lowerCaseString | lowerCased | lowerCase | lowerCaser | toLowerCase, asLowerCase | |
upperCaseString | upperCased | upperCase | upperCaser | toUpperCase, asUpperCase | |
capitalization | capitalized | capitalizer | toCapitalized, asCapitalized | ||
std.string (new in 2.068) | |||||
entabbed | entabber | ||||
detabbed | detabber | ||||
leftJustification | leftJustified | leftJustifier | |||
rightJustification | rightJustified | rightJustifier | |||
centerJustification | centerJustified | centerJustify | centerJustifier | ||
soundexed | soundexer |