ATOMIC AI FUNCTIONS SPEC (EN) SCOPE RULE: This document defines the complete and binding function system of the Atomic language. RULE: All rules defined here are mandatory. RULE: This specification applies to standard functions and user-defined functions. FUNCTION DEFINITION RULE: A function in Atomic is a named operation. RULE: All functions use the arrow syntax. SYNTAX: function name --> (ARGUMENT: value) (ARGUMENT: value) RULE: The arrow --> is mandatory. RULE: Functions may affect program state or produce a value. FUNCTIONS AND EXPRESSIONS RULE: Atomic operations are expressed using a combination of: expressions functions syntactic constructs RULE: Only functions use the arrow syntax -->. FUNCTION CATEGORIES (SEMANTIC) RULE: Atomic distinguishes two semantic categories of functions: functions that return no value functions that return a value RULE: The distinction is semantic, not syntactic. RULE: The term "command" is only a didactic simplification and has no formal meaning. FUNCTIONS WITHOUT RETURN VALUE RULE: A function without return value: performs an action may produce visible effects does not return any value cannot be assigned to a variable cannot be used in expressions may appear alone as an instruction FORBIDDEN: Assigning the result of a non-returning function. FUNCTIONS WITH RETURN VALUE RULE: A function returns a value if and only if its name starts with: ottieni RULE: All and only functions whose name starts with "ottieni" return a value. RULE: A value-returning function: must be used through assignment cannot appear alone cannot be used as an argument cannot be nested USAGE OF VALUE-RETURNING FUNCTIONS ALLOWED: variable = ottieni something --> (ARGUMENT: value) FORBIDDEN: using a value-returning function without assignment using a value-returning function as an argument nesting a value-returning function inside expressions nesting any function call FUNCTION ARGUMENTS RULE: Function arguments are name-value pairs. RULE: Arguments are enclosed in parentheses. RULE: Argument order is irrelevant. RULE: Arguments have default values. RULE: If an argument is omitted, its default value is used. RULE: Argument names may contain spaces. ALLOWED ARGUMENT VALUE TYPES RULE: Only the following are allowed as argument values: numbers text strings constants variables mathematical expressions FORBIDDEN: functions as argument values nested function calls any function call inside arguments STANDARD FUNCTIONS RULE: Standard functions are part of the Atomic language. RULE: Standard functions are documented in official thematic reference files. RULE: All standard functions obey the rules defined in this specification. RULE: If a function is not documented in official files, it is not part of the language. USER-DEFINED FUNCTIONS RULE: Atomic allows user-defined functions. SYNTAX: definisci funzione "function name" { code } RULE: User-defined functions follow the same rules as standard functions. USER-DEFINED FUNCTIONS WITHOUT RETURN VALUE RULE: A user-defined function without additional rules does not return any value. RULE: It behaves exactly like a standard non-returning function. USER-DEFINED FUNCTIONS WITH RETURN VALUE RULE: A user-defined function returns a value if and only if: its name starts with "ottieni" its definition explicitly contains the phrase: "con questa funzione ottieni ..." RULE: Both conditions are mandatory. RULE: If either condition is missing, the function returns no value. USER-DEFINED FUNCTION ARGUMENTS RULE: User-defined functions may use symbolic arguments. RULE: Symbolic arguments are referenced using: <"ARGUMENT NAME"> RULE: Symbolic arguments: represent passed values are not global variables are only accessible inside the function body FORMAL PROHIBITIONS FORBIDDEN: using a function as an argument nesting function calls using a value-returning function without assignment assigning the result of a non-returning function RULE: These prohibitions are part of the language syntax. FUNCTION CATEGORIZATION RULE: Atomic functions are organized into thematic categories. RULE: Categories are documented in separate reference files. RULE: This document does not list individual function names. LANGUAGE CLOSURE (FUNCTION SYSTEM) RULE: No functions exist beyond those documented in official Atomic files. RULE: If a name does not appear in official documentation: it is not a function it is not part of the Atomic language RULE: The function system is closed.