Group: type declaration
Topic: data type by lexical constraints
Topic: default value
Topic: initialization of data
| |
Summary
Declaration notation indicates a data object's name, type, scope, and initial value. For structured types the declaration often explicitly indicates the structure components and may indicate default values for unspecified components. The declaration may include an example of use for documentation. In large systems, declarations are often duplicated. This can be abbreviated by an "include" file or by grouping common declarations under a global name. (cbb 5/80)
Subtopic: variable declarations -- environment, binding
QuoteRef: wulfWA4_1974 ;;4 the colon ":" is the general binding operator
| Quote: related declarations should be grouped together and given a name; environment is a set of these groups [»towsE7_1979]
| Quote: declare a variable by its name and class identifier [»hendP9_1975]
| Subtopic: data type
Quote: in C, types are specified by expressions; it works well for simpler cases [»ritcDM7_1978c]
| Quote: in C, ornate types may be hard to interpret as a whole, but become understandable if read from inside out [»ritcDM7_1978c]
| Quote: provide implicit typing for initialized type declarations [»dorwSM1_1997]
| QuoteRef: boscR9_1973 ;;7 use rule type as prefix to rule eg 'action' a+b
| QuoteRef: kostCH_1974 ;;374 CDL data types 'pointer' buffer. eg 'macro' 'pointer' maxbuf= 200.
| QuoteRef: liskBH2_1976 ;;6 variables typed by : eg r: array (int)
| Subtopic: variables
Quote: need notation for single-assignment variables [»atkiMP6_1987]
| QuoteRef: liskBH2_1976 ;;5 i: int:=1 defines i as integer and sets it to 1
| QuoteRef: wirtN1_1971 ;;45 declarations by j,j: integer
| QuoteRef: wulfWA4_1974 ;;4 "a form can be instantiated simply by mentioning its name together with any requisite actual parameters" eg decl x: complex
| Subtopic: functions
QuoteRef: earlJ4_1974 ;;35 func (.brace. 1..m .brace.,.brace. 1..n .brace., real<-0) is a real n X m array with default 0
| Subtopic: pattern
QuoteRef: kiebRB9_1973 ;;4.4 declaration by match on pattern in class definition (unimplemented)
| Subtopic: scope
QuoteRef: sammJE_1969 ;;202 a|bc means variable abc is local
| QuoteRef: boscR9_1973 ;;8 affix by +, local variable by =, prefilled local by > before variable and returned local by > after variable
| Subtopic: structure
QuoteRef: wirtN1_1971 ;;42 record #field id# : type eg x,y: real variants by CASE #tag field id# : type of tag field of eg yellow: (record descriptor END terminates
| Subtopic: style
Quote: should disallow uninitialized variables and multiple names per declaration
| Quote: can use long, informative argument names in header files and short, convenient names in definitions; e.g., 'length_of_element_array' and 'n' [»stroB_1994]
|
Related Topics
Group: type declaration (5 topics, 110 quotes)
Topic: data type by lexical constraints (15 items)
Topic: default value (8 items)
Topic: initialization of data (45 items)
|