C Source Code Conventions and Abbreviations Dictionary: Difference between revisions

From NARS2000
Jump to navigationJump to search
mNo edit summary
(t/c)
 
(19 intermediate revisions by one other user not shown)
Line 3: Line 3:
==Conventions==
==Conventions==


{| class="wikitable" style="width: 50%;"
{| class="wikitable" style="width: 50%"
! Convention
! Convention
! Syntax
! Syntax
! Description/Where Used
! Description/Where Used
! Sample Use
! Purpose
! Purpose
|-
|-
| PrimFn
| '''PrimFn'''
| Prefix  
| Prefix  
| name prefix to all Primary APL functions
| name prefix to all Primary APL functions
| '''PrimFn'''Rho_EM_YY
| Quickly identify such names
| Quickly identify such names
|-
|-
| SysFn
| '''SysFn'''
| Prefix
| Prefix
| name prefix to all Quad type System Functions
| name prefix to all Quad type System Functions
| '''SysFn'''WA_EM_YY
| Quickly identify such names
| Quickly identify such names
|-
|-
| _EM_YY
| '''_EM_YY'''
| Suffix
| Suffix
| name suffix to all Primary APL functions AND Quad System Functions, including monadic and dyadic calls
| name suffix to all Primary APL functions AND Quad System Functions, including monadic and dyadic calls
| SysFnTS'''_EM_YY'''
| Quickly identify such names, referencing
| Quickly identify such names, referencing
|-
|-
Line 28: Line 32:
==Abbreviations Dictionary==
==Abbreviations Dictionary==


{| class="wikitable" style="width: 30%;"
{| class="wikitable" style="width: 70%"
! Abbrev.
! Abbrev
! Meaning
! Meaning
! Location Use
! Definition Location, Purpose, Cross Ref's
! Sample Source Code Usage
|-
|-
! tk
| '''APA'''
! token
| Arithmetic Progression Array
! Frequently found embedded in variable names.
| C code suffix to variable type, sometimes variable names. for example, ⍳6 or iota-6 is an '''arithmetic progression array''' of integers. Definition for ARRAY_'''APA''' found in file <datatype.h>
| ARRAY_'''APA''' is a variable type. Ref. wiki '''[[APA|documentation page APA]]'''. For closely examining '''APA ''' datatypes, see also '''[[System_Function_DR|System Function ⎕DR]]'''.
|-
|-
! lp
| '''lp'''
! long pointer
| long pointer
! Usually found as a prefix to variable names.  NARS makes frequent use of pointers to speed up processing times, to make NARS2000.exe more efficient.
| Usually found as a prefix to variable names.  NARS makes frequent use of pointers to speed up processing times, to make NARS2000.exe more efficient.
| '''lp'''tkRhtArg (var name; long ptr to token var structure of a right hand argument for a function call)
|-
|-
! NELM
| '''NELM'''
! Nested Element
| Number of Elements
! Usually embedded within variable names.
| Usually embedded within variable names. Conceptually like '''[[Rho|Rho or <apll>{rho}</apll>]]''' of a vector.
| APL'''NELM''' apl'''NELM'''Rht; // VarType VarName; Right arg NELM for variable type(APLNELM) and variable named aplNELMRht
|-
|-
| '''ODS'''
| OutputDebugString
| Variously used throughout program, especially see file <debug.c> for string printing to console, debugging. See function int oprintfW, usage example per <updates.c>, oprintfW (L"%3d:  SetEvent on %p (IDC_DNLPAUSE_BN -- hSuspend)\n", guCnt++, dnlThrStr.hSuspend);  % means "Prt var here"; 3 = "use at least 3 spaces(max width) to show, pad as needed"; d = "Var is int"; hex-%x; float-%f; str-%s; ptrs-%p. L prefix=unicode str
| int oprintfW(LPWCHAR lpwszFmt, ...)  // Ptr to format string, variable list
|-
| '''PerTab'''
| per tab, esp. per APL workspace tab
| Embedded in var names.  Detailed explanation of PerTab found in C source header file <pertab.h>.  '''NARS supports multiple simultaneously open and running workspaces.'''  Each workspace is displayed as a separate '''Tab''', much like folder tabs.  All variables in all workspace are distinctly maintained, with each PerTab.
| LP'''PERTAB'''DATA lpMemPTD; where LP'''PERTAB'''DATA is the variable type and lpMemPTD is a pointer to PerTabData global memory
|-
| '''PTD'''
| per tab of data
| Embedded in var names.  Each NARS workspace is kept separate and distinct in its own PTD.
| lpMem'''PTD''' structured var name, in this case a ptr to PerTabData global memory
|-
| '''Rank'''
| Rank
| Rank: Scalars=0, Vectors=1, Matrices=2..N.  Like {rho}{rho} of an APL variable or contained data structure, see shape of the shape '''[[Rho|RhoRho or {rho}{rho}]]'''.
| APL'''RANK''' apl'''Rank'''Lft // Left arg rank (variable type, variable name)
|-
| '''SIS'''
| State Indicator Stack
| Frequently embedded within variable and function names. Detailed explanation of SIS found in C source header file <sis.h>  See also APL's '''[[System_Command_SI|System Command )SI]]'''.
| lpMemPTD->lp'''SIS'''Cur->ResetFlag; (var name) AND Fill'''SIS'''Nxt (fcn name)
|-
| '''tk'''
| token
| Frequently found embedded in structured variable names. Tokens are [http://www.c4learn.com/c-programming/c-tokens-keywords-identifiers/ basic building blocks of C Programming]; hence '''tk''' vars frequently represent important structured variables in NARS.
| LPTOKEN lp'''tk'''RhtArg
|-
| '''TKT_'''
| token type
| Prefix to typed variable names. Most tokens are simple in that they have type and data only.e,g, TKT_LEFTPAREN and '('.  Some frequently used tokens are complex in that their data points to other data. Token types are also associated with a <u>Constant type '''value'''</u>, e.g. '''TKT_'''VARARRAY = '''1A'''(Hex val, 26 dec val). Token types may also represent APL/System Functions - '''TKT_'''FCNNAMED (52 hex) = a named function. Full explanation see file <tokens.h>. See also typedef structures '''[[Frequently_Used_TypeDef_Structures_and_Variables#TOKEN|TOKEN]]'''.
| '''TKT_'''VARARRAY - main workhorse token type.  Its tkData is an HGLOBAL (global memory handle) which contains an array which is either simple, nested, or mixed(combination of diff data types, e.g. string int float and or double).
|-
| '''UTF'''
| Unicode Transformation Format
| Variable names, constants, [http://unicode.org/faq/utf_bom.html especially UTF16]; algorithmic mapping for Unicode code numbers (except surrogate code points) to unique byte sequencing (esp. 16-bit = 2-byte sequences). ASCII uses 2^7 bits=128 codes; EBSDIC 2^8=256 codes. Unicode 2-byte uses 2^16=65,536 codes, as currently does NARS, see also System Functions '''[[System_Function_AV|<apll>{quad}</apll>AV]]''' and '''[[System_Function_UCS|<apll>{quad}</apll>UCS]]'''. Both the 32-bit and 64-bit NARS2000.exe's use 16-bit uncodes; the 32 and 64 bit NARS exe's refer to numeric data computer representations and calculation precisions. List of defined '''UTF'''16_ vars see file <Unicode.h>.
| '''UTF'''16_RHO
|}
|}
[[Category:NARS 2000]]

Latest revision as of 21:17, 13 October 2019

NARS C Source Code Conventions and Abbreviations Dictionary:

Conventions

Convention Syntax Description/Where Used Sample Use Purpose
PrimFn Prefix name prefix to all Primary APL functions PrimFnRho_EM_YY Quickly identify such names
SysFn Prefix name prefix to all Quad type System Functions SysFnWA_EM_YY Quickly identify such names
_EM_YY Suffix name suffix to all Primary APL functions AND Quad System Functions, including monadic and dyadic calls SysFnTS_EM_YY Quickly identify such names, referencing

Abbreviations Dictionary

Abbrev Meaning Definition Location, Purpose, Cross Ref's Sample Source Code Usage
APA Arithmetic Progression Array C code suffix to variable type, sometimes variable names. for example, ⍳6 or iota-6 is an arithmetic progression array of integers. Definition for ARRAY_APA found in file <datatype.h> ARRAY_APA is a variable type. Ref. wiki documentation page APA. For closely examining APA datatypes, see also System Function ⎕DR.
lp long pointer Usually found as a prefix to variable names. NARS makes frequent use of pointers to speed up processing times, to make NARS2000.exe more efficient. lptkRhtArg (var name; long ptr to token var structure of a right hand argument for a function call)
NELM Number of Elements Usually embedded within variable names. Conceptually like Rho or of a vector. APLNELM aplNELMRht; // VarType VarName; Right arg NELM for variable type(APLNELM) and variable named aplNELMRht
ODS OutputDebugString Variously used throughout program, especially see file <debug.c> for string printing to console, debugging. See function int oprintfW, usage example per <updates.c>, oprintfW (L"%3d: SetEvent on %p (IDC_DNLPAUSE_BN -- hSuspend)\n", guCnt++, dnlThrStr.hSuspend);  % means "Prt var here"; 3 = "use at least 3 spaces(max width) to show, pad as needed"; d = "Var is int"; hex-%x; float-%f; str-%s; ptrs-%p. L prefix=unicode str int oprintfW(LPWCHAR lpwszFmt, ...) // Ptr to format string, variable list
PerTab per tab, esp. per APL workspace tab Embedded in var names. Detailed explanation of PerTab found in C source header file <pertab.h>. NARS supports multiple simultaneously open and running workspaces. Each workspace is displayed as a separate Tab, much like folder tabs. All variables in all workspace are distinctly maintained, with each PerTab. LPPERTABDATA lpMemPTD; where LPPERTABDATA is the variable type and lpMemPTD is a pointer to PerTabData global memory
PTD per tab of data Embedded in var names. Each NARS workspace is kept separate and distinct in its own PTD. lpMemPTD structured var name, in this case a ptr to PerTabData global memory
Rank Rank Rank: Scalars=0, Vectors=1, Matrices=2..N. Like ⍴⍴ of an APL variable or contained data structure, see shape of the shape RhoRho or ⍴⍴. APLRANK aplRankLft // Left arg rank (variable type, variable name)
SIS State Indicator Stack Frequently embedded within variable and function names. Detailed explanation of SIS found in C source header file <sis.h> See also APL's System Command )SI. lpMemPTD->lpSISCur->ResetFlag; (var name) AND FillSISNxt (fcn name)
tk token Frequently found embedded in structured variable names. Tokens are basic building blocks of C Programming; hence tk vars frequently represent important structured variables in NARS. LPTOKEN lptkRhtArg
TKT_ token type Prefix to typed variable names. Most tokens are simple in that they have type and data only.e,g, TKT_LEFTPAREN and '('. Some frequently used tokens are complex in that their data points to other data. Token types are also associated with a Constant type value, e.g. TKT_VARARRAY = 1A(Hex val, 26 dec val). Token types may also represent APL/System Functions - TKT_FCNNAMED (52 hex) = a named function. Full explanation see file <tokens.h>. See also typedef structures TOKEN. TKT_VARARRAY - main workhorse token type. Its tkData is an HGLOBAL (global memory handle) which contains an array which is either simple, nested, or mixed(combination of diff data types, e.g. string int float and or double).
UTF Unicode Transformation Format Variable names, constants, especially UTF16; algorithmic mapping for Unicode code numbers (except surrogate code points) to unique byte sequencing (esp. 16-bit = 2-byte sequences). ASCII uses 2^7 bits=128 codes; EBSDIC 2^8=256 codes. Unicode 2-byte uses 2^16=65,536 codes, as currently does NARS, see also System Functions AV and UCS. Both the 32-bit and 64-bit NARS2000.exe's use 16-bit uncodes; the 32 and 64 bit NARS exe's refer to numeric data computer representations and calculation precisions. List of defined UTF16_ vars see file <Unicode.h>. UTF16_RHO