PL2 - approach 0.01. Units

This article is for those who are looking for a new approach to programming,
and understand the global nature of the errors of modern programming,
tied to the architecture of existing computing systems, and not to the simulated world.

The report suggests the main classes that are able to describe the properties used in a high school course.
The basics of the approach are described in the articles listed in habrahabr.ru/post/176249

So, the ideology of the structure of classes in namespaces:


Maths:

root_ns.science.mathematics.Enumerator_class
enumerator natural
from 0 to the upper bound of the type used or to a specified value
dimensionless value
inheriting classes can indicate and compare units of measurement
root_ns.science.mathematics.Counter_class
Total number of counting values
Allows negative numbers
Limited by physical implementation of the number
Dimensionless quantity
The following classes indicate the unit of measure.

Physics

During operations, the unit is monitored with warnings
in the absence of the described conversion
root_ns.science.mathematics.Scalar_class
Scalar measured value with unit
root_ns.science.mathematics.Complex_class
Complex number
Can be represented in vector or trigonometric form
root_ns.science.mathematics.Tensorclcl
Tensor value

root_ns.science.physics.SI.One_class
class SI units
enumeration of units with default units
L - distance, m
M - mass, kg
T - time, s
...
root_ns.science.physics.SI.Multiply_class
A comprehensive SI unit of measure
includes a list of dimensions with the degree of occurrence and units of measure for each dimension.
At the same time, the same dimensions with different units of measure can be included several times

root_ns.science.physics.Measure_class
class to indicate the measured scalar quantity

root_ns.science.physics.Measured_Template
Class template for operations with units of measurement
Contains a precision index in the number of decimal places
Contains a precision analysis and a rounding operation



root_ns.science.logical.Base_class
Logical relationships
root_ns.science.structures.Listiner_template
Subjects of attention
root_ns.science.structures.Self_template
root_ns.science.structures.tuples.Tuple_class
tuple (requisite with requisites, each one or tuple)
UPD - Discussion of similar topics:
habrahabr.ru/post/144334 Type-rich Programming (C ++ 11)

Also popular now: