Design rationale of these Javascript functions

Dr. Philippe MARTIN


Content normalization (paradigm). These functions use a style compatible with purely functional programming and hence declarative programming. Indeed, this has many advantages. It eases the reuse, analysis (proof, ...) and parallelization of functions, their conversion to other programming languages or their use along with functions from other programming paradigms, including logic programming.
More precisely, one of the goals is to help programmers design applications that let their end users parameter them as much as possible (including their functions and interfaces). This implies specifying the data and functions (processes, interfaces, ...) of these applications in a declarative way in a knowledge-based system and its ontology and, when needed, help each end user specialize, adapt or complement these specifications. For specifying the data an interfaces, the use of a knowledge representation language (KRL) is then necessary. The processes have to be specified in a declarative way. Here are the three possible ways by decreasing order of easiness for process analysis and parametrization but increasing order of easiness for specifying them: i) using a KRL, ii) logic programming, and iii) purely functional programming. These functions support the third way. The interpreted nature of Javascript help enabling dynamic specification of processes by the end-user.
In practice:


Presentation normalization (programming style: conventions for program presentation). The goal of the used style is to make the functions as easy to retrieve, understand and reuse as possible. This implies i) making thing as formally explicit as possible (here "formally" means "usable by a software"), and ii) using a concise style when this does not conflict with explicitness. The second point comes from the limited short-term memory of most people: functions should be as short as possible for people to see as much of them without scrolling and thus undest and compare the easily. If scrolling is necessary, debugging or reuse time is greatly increased.
In practice, these functions