Codish Lexicon
One word for one meaning, One meaning for one word,
Symmetric opposites, Comprehensive classes.
A dictionary of computer programming names.
path — a list of edges that a cursor can traverse starting at a given vertex and stoping at another. related in the context of file system paths: normal, absolute, canonical aka: segment, segments related: edges mentioned: canonize, parent ✍
list
— a linear collection that provides fast put, push, pop, shift, and unshift operations. an ordered nonunique linear collection. applies to directory listing. distinct: symbols includes: queue, deque, staque python: list()
edge — a connection in a graph that starts at one vertex and stops at another. mentioned: atan, complete, depth, graph, machine, path, stable, transitive relation, transitive ✍
cursor — a number or a pointer to a position in any number of dimensions. aka: pointer distinct: ref ✍
start — to start moving a cursor from the beginning of a stream. distinct: begin, boot, halt opposite: stop aka: boot, play ✍
stop — to stop a moving cursor and send the cursor to the beginning of a stream or machine. distinct: end related: finish, halt distinct: abort, halt, shutdown aka: boot opposite: start mentioned: edge, event, path, restart, return, run, temporal, wait ✍
normal — file system: returns the one equivalent path that does not include parent ("..") and self (".") path components. is: idempotent distinct: canonical, absolute geometry: a binary relation between a line and a plane that returns whether the line is perpendicular with every intersecting line in the plane. distinct: perpendicular, orthogonal ✍
absolute — returns the fully qualified path for a given path and the cwd. is: stateless, idempotent distinct: abs, normal, canonical ✍
canonize — concept: to convert a path to a canonical path, usually with the canonical transitive function. aka: canonicalize ✍
parent — file system: a directory arrived at by the path component "..". the root of a file system often has a parent link to itself. related: child, root, leaf, base, ancestor, descendant opposite: child transitive: ancestors mentioned: heap array, normal, parent class ✍
queue — a linear collection that only provides shift and push for storage and retrieval, such that the first value pushed is always the first value shifted (fifo). queues operations are often atomic, so they can be used to pass messages safely between threads or processes. aka: dequeue, enqueue distinct: signal mentioned: linear collection, list, ordered, que ✍
deque — an ordered linear collection that provides shift, unshift, push, and pop as its storage and retrieval functions. a deque can be implemented as a list or a regrowable, cyclic array. seuss: an ordered linear que that provides shift, shoft, pish, and posh as its storage and retrieval functions. mentioned: linear collection ✍
symbols — a collection of symbols for a given object's attributes (attrs). is analgous to keys on a dict. see: attrs aka: dir distinct: list ✍
linear — having 1 dimension. an array is a linear collection. related: scalar, planar, spatial, temporal aka: planar ✍
collection — a class of compound objects that contain and organize values. attrs: len, has, get, set, reset, getset, put, del, cut, insert, remove, discard, empty, erase classes: linear collection, planar collection, spatial collection seuss: que classes: dict related: compound ✍
put — insert a value at given key. for non-unique collections like an array or list, put does not replace the value at the given index, but bumps all successive values down 1 position. distinct: set, insert pertains: collection ✍
push — to augment a linear collection in place by adding a value to the end. opposite: pop, unshift python: append related: extend seuss: posh perl: [array]: append one or more elements to an array† aka: append, array push, enqueue related: concatenate pertains: ordered mentioned: bag, deque, list, queue, stack ✍
pop
— to remove and return the last value of a linear collection. seuss: shoft python: dict: D.pop(k[,d])
shift — to remove and return the first value of a linear collection. python: the idiom for shift in python is to pop with a position of zero. opposite: unshift, pop seuss: opposite: shoft, pish perl: [array]: remove the first element of an array, and return it† aka: array shift, dequeue, pip pertains: ordered opposite: shoft mentioned: bag, deque, list, queue ✍
unshift — to augment a linear collection in place by adding a value to the beginning, moving existing values rightward. python: the idiom for unshift in python is to use insert with a position of zero. aka: bump, propend, prepend seuss: pish perl: [array]: prepend more elements to the beginning of a list† aka: array unshift pertains: ordered opposite: push, shift mentioned: bag, deque, list ✍
ordered — pertains to collections that maintain the respective order of their contents. interfaces: list, queue, deque, stack attrs: push, pop, shift, unshift, first, last, begins, ends, trim left, trim right, rot left, rot right, chip, chop, erase implementations: array, chain related: sorted, unordered related: iterable ✍
| left | right |
|---|---|
| unshift | push |
| shift | pop |
| first | last |
| begins | ends |
| trim left | trim right |
| rot left | rot right |
| chip | chop |
bale — transforms an iterable into a list of accumulated sub-lists of a given length. related: zip, add aka: xargs pertains: iterable ✍
baled([1, 2, 3, 4]) eq [[1, 2], [3, 4]]
baled([1, 2, 3, 4, 5, 6], 3) eq [[1, 2, 3], [4, 5, 6]]
baled([1, 2, 3, 4, 5], 3) eq [[1, 2, 3], [4, 5]]
baled([1, 2, 3, 4, 5], 3, 0) eq [[1, 2, 3], [4, 5, 0]]
shell idiom: input | xargs -n 2
count
— a stateful destructive operation that returns the number of values in an iteration. distinct: length python: list: L.count(value)
enumerate
— to assign nominal values to each respective value in a list, effectively creating the map that relates each ordinal offset in a list with its respective value. python: enumerate(iterable)
extend — python: to augment a linear collection in place by adding all of the values of another collection to the end. javascript: the idiom for extend in javascript is to call push variadically, as in this.push.apply(this, other). presently has no codish name. distinct: update, add related: push python: list: L.extend(iterable) extend list by appending elements from the iterable.† mentioned: poshy ✍
filter
— to return a stable copy of a list omitting all of the values that fail a given condition (boolean function). distinct: where python: filter(function or None, sequence)
has — returns whether a collection contains an value. returns whether a list contains a value. returns whether a dict contains a key. has(collection, value) distinct: in aka: contains, exists aka: array key exists, has key, has value, includes pertains: collection distinct: has attr commute: in mentioned: complexity function, discard ✍
index
— a key number for an ordered linear collection. finds the first value that matches a given value and returns its key number. otherwise returns -1 to indicate failure. opposite: last index aka: offset, pos python: list: L.index(value, [start, [stop]])
insert — to add a value to a collection. opposite: remove python: list: L.insert(index, object) insert object before index.† pertains: bag, collection distinct: put mentioned: unshift ✍
join
— to interpolate a delimiter between a list of texts. to interpolate a list between a list of lists. aka: implode distinct: wait python: str: S.join(sequence)
linear collection — a collection for storage and retrieval of values in a 1-dimensional domain. linear collections can be ordered, sorted, or unordered. linear collections can be unique or nonunique. linear collections may be mappings. interfaces: list, bag, dict, queue, deque, stack implementations: array, chain, tree, hash array, heap array, trie classes: bag, string is: collection mentioned: bague, hash ✍
| ordered | nonunique | list, deque, queue, stack | |
| ordered | nonunique | mapping | ordered multi dict |
| ordered | unique | ordered bag | |
| ordered | unique | mapping | ordered dict |
| sorted | nonunique | sorted multi bag | |
| sorted | nonunique | mapping | sorted multi dict |
| sorted | unique | sorted bag | |
| sorted | unique | mapping | sorted dict |
| unordered | nonunique | multi bag | |
| unordered | nonunique | mapping | multi dict |
| unordered | unique | bag | |
| unordered | unique | mapping | dict |
Some collections are defined by the subset of the collection interface that they implement. By declaring the subset of a collection interface that you intend to use, you provide performance optimization opportunities for the underlying implementation. For example, if you only use push and pop, the implementation can be chain with nearly instantaneous storage and retrieval.
| push | pop | shift | unshift | random access | interface |
|---|---|---|---|---|---|
| push | pop | shift | unshift | random access | list |
| push | pop | shift | unshift | deque | |
| push | shift | queue | |||
| push | pop | stack |
matrix — an ordered planar collection of numbers with certain algebraic properties and pertinent functions. a matrix is not ragged. a rectilinear list of lists of numbers with certain algebraic properties. distinct: table mentioned: math, unit ✍
remove — removes a value from a collection, based on its value, not its key or position. opposite: insert distinct: del, erase aka: rm python: list: L.remove(value) remove first occurrence of value.† python: set: Remove an element from a set; it must be a member. If the element is not a member, raise a KeyError.† pertains: bag, collection aka: unlink mentioned: discard, strip, strop, trim begin, trim end, trim ✍
reverse — to reverse a linear collection in place. is: stateful distinct: reversed opposite: reverse aka: tac python: list: L.reverse() reverse *IN PLACE*.† perl: [list]: flip a string or a list† aka: array reverse ✍
seq — an ordered lazy linear collection defined by a basis and recursive function. seq takes a variadic list of basis parameters (the first values of the sequence). The last parameter is the recursive function. the Fibonacci sequence can be lazily generated with the lazy iteration returned by seq(1, 1, add). mentioned: seed, seque ✍
sort
— to arrange a linear collection in strictly non-descending order in place given a suitable definition of comparison. To sort implies a guarantee of "strong" sorting; that is, equivalent elements retain their relative positions to one another. distinct: sorted python: list: L.sort(cmp=None, key=None, reverse=False) stable sort *IN PLACE*;; cmp(x, y)
split
— returns the list of texts that were interpolated by a delimiter in a given text. returns the list of lists that were interpolated by a delimiterd in a given list. aka: explode python: str: S.split([sep [,maxsplit]])
©2009 Kris Kowal
Codish Lexicon by Kris Kowal is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.
