Support #395
Naming conventions: upper or lower case?
Description
Our naming conventions for functions name in CoCoA-5 are as follows:
- one word: lower case
Ex: factor, ideal, det, ...
- more words: CamelCase (all words start with capital letter)
Ex: HilbertFn, DivAlg, GBasis, SmoothFactors, ...
Types are all upper-case: IDEAL, RINGELEM, BOOL, ...
What can be done for backward compatibility with CoCoA-4
in packages/BackwardCompatible.cpkg5) we have defined (all?) the old CoCoA-4 functions names to call the new ones, so that old code and old habits do not cause problems.
What cannot be done for backward compatibility with CoCoA-4
Also names for record fields will follow the same conventions ("one convention to rule them all"), so the very few functions returning a record might have slightly different field names.
We will list them here.
Keywords: capitalization, capitals, capital letters
Related issues
History
#1
Updated by Anna Maria Bigatti almost 11 years ago
- % Done changed from 10 to 50
- DivAlg
- IdealAndSeparatorsOfPoints
- IdealAndSeparatorsOfProjectivePoints
- MantissaAndExponent
- RealRoots, RealRootRefine
- factor
- CoefficientsWRT [JAA 20140325]
(more will be added here as soon as I find them ;-)
AlmostQR stays with fields Q and R (would be ridiculous otherwise, I think...)
Anyway the interpreter usefully helps you:
ERROR: Cannot find a field named "Sup". A similarly named (existing) field is: "sup"
#2
Updated by Anna Maria Bigatti over 10 years ago
- Subject changed from Naming conventions: upperr or lower case? to Naming conventions: upper or lower case?
#3
Updated by John Abbott over 10 years ago
JAA will ensure that all existing packages work without BackwardCompatible.cpkg5
; this is simply a matter of code cleanliness.
#4
Updated by John Abbott over 10 years ago
- Target version changed from CoCoA-5.0.9 to CoCoA-5.1.0 Easter14
#5
Updated by John Abbott over 10 years ago
What about ACRONYMs? So far gcd
and lcm
are lowercase.
What about C5 language keywords?
The next actions:- change C5 source code so that any code which is output follows the conventions
- check/correct the manual (incl. examples)
- check/correct packages
- check/correct C5 test suite
- update the emacs UI, and the GUI?
For Record
the C5 source files to change are: AST.C
, C5.C
, Interpreter.C
, Lexer.C
, Parser.C
#6
Updated by John Abbott over 10 years ago
- Status changed from In Progress to Closed
Closing because already covered by #395
#7
Updated by Anna Maria Bigatti over 10 years ago
- % Done changed from 50 to 100
- Estimated time set to 3.00 h