CPL uses brackets just as you were taught in school. All three kinds of round, square, and curly brackets are interchangeably available in matched pairs for grouping arithmetic expressions or lists of parameters, with no distinction between function arguments and array subscripts. Parentheses, brackets and braces can thus be alternated, at the user's discretion, which is beneficial to the human eye's reading and proofreading nested formulas and enhances automatic error catching.
The provided code editor can automatically alternate bracket styles and match bracket pairs for you.
CPL treads a middle ground by making C-like use of pointers possible, but concealing the near totality of referencing and dereferencing operations under implicit type conversion. Pointer declarations decide whether a function argument is passed by value or by reference, but no special notation has to be used in function calls. Pointer arithmetics is allowed within the allocated memory space of a declared compound variable, and enforced to stay there when run-time error checking is on.
In CPL the symbolic.cpl library provides concurrent symbolic differentiation capabilities. Not only can CPL work backwards through a chain of expressions to calculate a symbolic derivative (discrete adjoint), but it does so transparently without the user needing to even see the intermediate code generated by automatic differentiation: any desired symbolic derivatives are worked out during compilation and inlined in the generated code.
In numerical optimization problems, once the expression of an objective function is programmed in, its derivatives with respect to either a scalar parameter or an array element become immediately available in the same code and can be denoted symbolically just as one would on paper.
Array bounds can be queried through the LO and HI builtin functions, and are run-time checked by the rtchecks module.
A rich set of subarray selections, commuting with structure fields, is efficiently supported.
Additionally, any function provided by an external C or FORTRAN library can be seamlessly called in a CPL program with no performance penalty.
headeror
interfacefiles that inconveniently duplicate the definitions contained in the program proper.
CPL checks prototype coherence by polling the USEd files in stead of headers, and issues compile-time errors accordingly. The prototype-enforcing process is totally transparent to the user who no longer needs to write separate header files (but may if one wants to).
classobject.
Polymorphism, on the over hand, causes a function to behave differently based on the type of its arguments, not necessarily only of the object that calls/invokes it.
CPL supports the object paradigm but avoids the inclusion of function definitions inside classes in favour of overloaded, polymorphic functions that are qualified by the (oftentimes STRUCTURE) type of one or more of their arguments. It caters for subtyping and inheritance through anonymous STRUCTURE fields, and for dynamically typed objects through DYNAMIC pointers.
cpl make <program>[.cpl] [<option>]is all that is needed to compile and link the source file <program>.cpl into the executable file <program>, which you can then run by its name just like any other executable.
Although CPL is compiled, the straight cpl run command makes it act just like a scripting language, directly running a plain-text CPL file by transparently compiling it when and only when it detects a modification.
If invoked from a hashbang, cpl run makes CPL code executable like a script, but at compiled-code speed.
The interactive CPL interpreter accepts expressions, statements or commands at a console prompt. Any CPL or C or FORTRAN library can be loaded into the interpreter and have its functions invoked from the command prompt, either alone or embedded in a greater CPL command or expression. Unix-shell commands are accepted as well, just as are functions from the system C library.
Unlimited undo and redo functionality is supported, of a lossless kind that goes beyond the one found in most editors. Memory of past edits is not lost even when further edits take place after an undo, and the user can choose whether to see the session's history in a traditional or extended sequence.
The CPL editor features a multiple-selection buffer: right after an insertion, pressing the insertion key again replaces the just inserted text by the historically former selection. You can recall and insert the last three items that you have recently selected, written or deleted; just try pressing Insert, and if what you see is not what you want, press Insert again.
classesonly contain data and not functions, and are therefore ordinary STRUCTUREs. They do offer reusability, however, in that derived STRUCTUREs, containing the data fields of a base type plus their own, can be implicitly converted to their base type. All CPL functions are polymorphic and coactivated by the type of their arguments, and therefore functions declared with the base type as argument can automatically be reused on the derived type without modification (or just their name can be reused to declare a more specific function, as one sees fit). Since functions do not belong to a single class, reusability can be applied to more than one argument, possibly at the same time. When only the first argument is involved, a C++-like dot notation is available to be used where it sounds more adapt to the application.
CPL?