Project

General

Profile

Support #395

Naming conventions: upper or lower case?

Added by Anna Maria Bigatti almost 11 years ago. Updated over 10 years ago.

Status:
Closed
Priority:
Normal
Category:
Renaming
Target version:
Start date:
01 Aug 2013
Due date:
% Done:

100%

Estimated time:
3.00 h
Spent time:

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

Related to CoCoA-5 - Feature #392: add Value::from(factorization<..>)Closed2013-07-24

Related to CoCoA-5 - Feature #393: add Value::from(HPSeries)Closed2013-07-24

Related to CoCoA-5 - Feature #523: EmacsUI: lower case keywordsClosed2014-04-04

Is duplicate of CoCoA-5 - Design #472: Record keywordClosed2014-03-13

History

#1 Updated by Anna Maria Bigatti almost 11 years ago

  • % Done changed from 10 to 50
Functions returning record (changed with new coding conventions)
  • 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

Also available in: Atom PDF