Updated docs

This commit is contained in:
acano 2026-03-06 11:38:06 +01:00
parent 6692990a38
commit a434d34676
19 changed files with 292 additions and 193 deletions

View File

@ -81,12 +81,12 @@ startLoop() try: print(1 / 0) except: raise RuntimeError("Something went wrong")
Break Statement Break Statement
In AVAP, the break statement is used to terminate the closest enclosing loop. The syntax for the break statement is as follows: In AVAP, the break statement is used to terminate the closest enclosing loop. The syntax for the break statement is as follows:
break break()
When a break statement is encountered, it causes the loop to exit immediately, regardless of the loop's condition or any remaining iterations. This effectively transfers control to the statement following the loop. When a break statement is encountered, it causes the loop to exit immediately, regardless of the loop's condition or any remaining iterations. This effectively transfers control to the statement following the loop.
The break statement is typically used within for or while loops to provide a way to exit the loop prematurely based on a certain condition. The break statement is typically used within for or while loops to provide a way to exit the loop prematurely based on a certain condition.
for i in range(10): if i == 5: break print(i) print("Loop ended") addVar(_status, "OK") startLoop(idx, 0, 9) if(idx, 4, "==") idx = -1 break() end() endLoop() addResult(idx) addStatus("OK")
In this example, the loop will terminate when i equals 5, and "Loop ended" will be printed. The numbers 0 through 4 will be printed before the loop is exited. In this example, the loop will terminate when i equals 5, and "Loop ended" will be printed. The numbers 0 through 4 will be printed before the loop is exited.
Break Statement Break Statement
@ -109,16 +109,16 @@ When continue is used within a loop that is also handling exceptions with a try
for i in range(10): try: if i % 2 == 0: continue print(i) finally: print("In finally clause") print("Loop ended") for i in range(10): try: if i % 2 == 0: continue print(i) finally: print("In finally clause") print("Loop ended")
In this example, the continue statement will skip the current iteration when i is even, but before moving to the next iteration, the finally clause will print "In finally clause." For odd numbers, the loop will print the number and then "In finally clause." After the loop finishes, "Loop ended" will be printed. In this example, the continue statement will skip the current iteration when i is even, but before moving to the next iteration, the finally clause will print "In finally clause." For odd numbers, the loop will print the number and then "In finally clause." After the loop finishes, "Loop ended" will be printed.
Import Statement Include Statement
In AVAP, the import statement is used to import an entire code file and define names in the local namespace. The syntax for the import statement is as follows: In AVAP, the include statement is used to include an entire code file and define names in the local namespace. The syntax for the include statement is as follows:
import file.avap include file.avap
The import statement in AVAP imports an entire code file and makes it available in the local namespace. No alias is assigned to the imported file; the file is simply referred to by its name. The include statement in AVAP includes an entire code file and makes it available in the local namespace. No alias is assigned to the included file; the file is simply referred to by its name.
For example: For example:
# In the 'module.avap' file example_variable = 10 # In the main file import module.avap print(module.avap.example_variable) # Will print 10 # In the 'module.avap' file example_variable = 10 # In the main file include module.avap addResult(example_variable) # Will print 10
In this example, the main file imports the module.avap file and can access the example_variable defined in that file using the module.avap syntax. In this example, the main file includess the module.avap file and can access the example_variable defined in that file using the module.avap syntax.
Compound Statements Compound Statements
In AVAP, compound statements contain (groups of) other statements; these affect or control the execution of those other statements in some way. In general, compound statements span multiple lines, though in simpler representations a complete compound statement might be contained within a single line. In AVAP, compound statements contain (groups of) other statements; these affect or control the execution of those other statements in some way. In general, compound statements span multiple lines, though in simpler representations a complete compound statement might be contained within a single line.
@ -133,7 +133,7 @@ In AVAP, control flow structures include conditional statements and loops, which
If Statements If Statements
The syntax for an if statement in AVAP is: The syntax for an if statement in AVAP is:
if (variable, variableValue, comparator, expression): code to execute if (variable, variableValue, comparator, expression) code to execute else() code to execute end()
This structure checks if the condition (variable compared to variableValue with the given comparator) is true, and if so, executes the block of code. This structure checks if the condition (variable compared to variableValue with the given comparator) is true, and if so, executes the block of code.
Loops Loops
@ -145,13 +145,13 @@ This structure initiates a loop where the variable iterates from the 'from' valu
The if Statement The if Statement
The if statement in AVAP is used for conditional execution. The syntax is as follows: The if statement in AVAP is used for conditional execution. The syntax is as follows:
if (variable, variableValue, comparator, expression): code to execute if (variable, variableValue, comparator, expression) code to execute else() code to execute end()
This statement evaluates the condition specified by the variable, variableValue, comparator, and expression. It selects exactly one of the suites (blocks of code) by evaluating the expressions one by one until a true condition is found. The corresponding suite is then executed. If all conditions are false, no suites are executed. This statement evaluates the condition specified by the variable, variableValue, comparator, and expression. It selects exactly one of the suites (blocks of code) by evaluating the expressions one by one until a true condition is found. The corresponding suite is then executed. If all conditions are false, no suites are executed.
The try Statement The try Statement
The try statement in AVAP specifies exception handlers and/or cleanup code for a block of statements. The syntax is as follows: The try statement in AVAP specifies exception handlers and/or cleanup code for a block of statements. The syntax is as follows:
try(): code to execute except(): code to execute try() code to execute exception() code to execute end()
The try block contains code that might raise an exception. The except block contains code to handle exceptions raised by the try block. If an exception occurs, control is transferred to the except block. If no exception occurs, the except block is skipped. The try block contains code that might raise an exception. The exception block contains code to handle exceptions raised by the try block. If an exception occurs, control is transferred to the except block. If no exception occurs, the except block is skipped.
Additional information about exceptions can be found in the section Exceptions, and information about using the raise statement to throw exceptions can be found in the section The raise Statement. Additional information about exceptions can be found in the section Exceptions, and information about using the raise statement to throw exceptions can be found in the section The raise Statement.

View File

@ -35,14 +35,15 @@ Example of import usage:
avap avap
// Content of the file main.avap // Content of the file main.avap
addVar(10, x) addVar(x, 10)
import functions.avap include functions.avap
myFunction(x) myFunction(x)
// Content of the file functions.avap // Content of the file functions.avap
def myFunction(y): function myFunction(y){
addVar(y + 5, result) addVar(result, y + 5)
print(result) addResult(result)
}
4.4. Exceptions 4.4. Exceptions
Exceptions in AVAP allow for the handling of errors or exceptional conditions. An exception is raised when an error is detected; it can be handled by the surrounding code block or by any code block that directly or indirectly invoked the block where the error occurred. Exceptions in AVAP allow for the handling of errors or exceptional conditions. An exception is raised when an error is detected; it can be handled by the surrounding code block or by any code block that directly or indirectly invoked the block where the error occurred.
@ -50,10 +51,11 @@ The AVAP interpreter raises an exception when it detects a runtime error. An AVA
Example of exception handling: Example of exception handling:
try: try()
addVar(10 / 0, result) addVar(10 / 0, result)
except ZeroDivisionError: except()
print("Cannot divide by zero.") addResult("Cannot divide by zero.")
end()
In this example, if a division by zero occurs, a ZeroDivisionError exception is raised and handled by the except block. In this example, if a division by zero occurs, a ZeroDivisionError exception is raised and handled by the except block.
This structure ensures that AVAP programs execute in a sequential and predictable manner, without advanced dynamic or deferred execution features, maintaining simplicity and clarity in name binding and import handling. This structure ensures that AVAP programs execute in a sequential and predictable manner, without advanced dynamic or deferred execution features, maintaining simplicity and clarity in name binding and import handling.
@ -61,26 +63,27 @@ This structure ensures that AVAP programs execute in a sequential and predictabl
5. The Import System in AVAP 5. The Import System in AVAP
AVAP code in one file gains access to code in another file through the import process. The import statement is the only way to invoke the import machinery in AVAP. AVAP code in one file gains access to code in another file through the import process. The import statement is the only way to invoke the import machinery in AVAP.
The import statement inserts the contents of the specified file at the exact point where the import statement appears in the original file. There are no other ways to invoke the import system in AVAP. The include statement inserts the contents of the specified file at the exact point where the import statement appears in the original file. There are no other ways to invoke the import system in AVAP.
When an import statement is executed, the contents of the imported file are processed as if they were part of the original file, ensuring that all functions and variables from the imported file are available in the context of the original file. If the specified file is not found, a FileNotFoundError is raised. When an include statement is executed, the contents of the imported file are processed as if they were part of the original file, ensuring that all functions and variables from the imported file are available in the context of the original file. If the specified file is not found, a FileNotFoundError is raised.
Example of using the import statement in AVAP: Example of using the include statement in AVAP:
Content of file main.avap Content of file main.avap
addVar(10, x) addVar(x,10)
import functions.avap include functions.avap
myFunction(x) myFunction(x)
Content of file functions.avap Content of file functions.avap
def myFunction(y): function myFunction(y){
addVar(y + 5, result) addVar(result, y + 5)
print(result) addResult(result)
}
In this example, the content of functions.avap is inserted into main.avap at the point of the import statement, ensuring that myFunction is defined before being called. In this example, the content of functions.avap is inserted into main.avap at the point of the import statement, ensuring that myFunction is defined before being called.
5.1. Import Rules 5.1. Import Rules
Position of Import: The import statement must be placed at the exact location where the content of the imported file is to be included. The content of the imported file is executed linearly along with the original file. Position of Import: The include statement must be placed at the exact location where the content of the imported file is to be included. The content of the imported file is executed linearly along with the original file.
Import Error: If the file specified in the import statement is not found, a FileNotFoundError is raised. Import Error: If the file specified in the include statement is not found, a FileNotFoundError is raised.
Scope of Imports: The functions and variables from the imported file are added to the local scope of the original file at the point of import. This means they can be accessed as if they were defined in the same file. Scope of Imports: The functions and variables from the imported file are added to the local scope of the original file at the point of import. This means they can be accessed as if they were defined in the same file.
5.2. Limitations and Considerations 5.2. Limitations and Considerations
No Packages: Unlike other languages, AVAP does not have a hierarchical package system. Each file is imported independently and treated as an autonomous unit. No Packages: Unlike other languages, AVAP does not have a hierarchical package system. Each file is imported independently and treated as an autonomous unit.
@ -91,18 +94,19 @@ Consider the following example where multiple files are imported:
Content of the file main.avap Content of the file main.avap
addVar(5, a) addVar(5, a)
import utilities.avap include utilities.avap
import operations.avap include operations.avap
addVar(utilities.increment(a), b) addVar(b, increment(a))
addVar(operations.multiply(b, 2), c) addVar( c, multiply(b, 2))
print(c) addResult(c)
Content of the file utilities.avap Content of the file utilities.avap
def increment(x): function increment(x){
return x + 1 return(x + 1)
}
Content of the file operations.avap Content of the file operations.avap
def multiply(x, y): function multiply(x, y){
return x * y return(x * y)
In this example, utilities.avap and operations.avap are imported into main.avap at the specified points, allowing the increment and multiply functions to be used in main.avap. }
In this example, utilities.avap and operations.avap are imported into main.avap at the specified points, allowing the increment and multiply functions to be used in main.avap.

View File

@ -4,9 +4,9 @@ The IF-THEN-ELSE statement in AVAP™ allows for decision-making based on specif
6.1 Syntax of the IF-THEN-ELSE Statement 6.1 Syntax of the IF-THEN-ELSE Statement
The basic syntax of the IF-THEN-ELSE statement in AVAP™ is as follows: The basic syntax of the IF-THEN-ELSE statement in AVAP™ is as follows:
IF(condition, true_value, operator) if(condition, true_value, operator)
// Block of code if the condition is true ELSE // Block of code if the condition is true else()
// Block of code if the condition is false END() // Block of code if the condition is false end()
condition: This is an expression that evaluates to either true or false. condition: This is an expression that evaluates to either true or false.
true_value: This is the value assigned if the condition is true. true_value: This is the value assigned if the condition is true.
operator: This is the operator used to compare the condition with the true value. operator: This is the operator used to compare the condition with the true value.
@ -17,9 +17,11 @@ Below is the description of each part of the IF-THEN-ELSE statement using the pr
// IF, ELSE and END Sample Use // IF, ELSE and END Sample Use
addVar(selector,'yes') addVar(selector,'yes')
IF(selector,'yes','=') if(selector,'yes','=')
addVar(result,1) ELSE() addVar(result,1)
addVar(result,0) END() else()
addVar(result,0)
end()
addResult(result) addResult(result)
The variable selector is initialized with the value 'yes'. The variable selector is initialized with the value 'yes'.
The statement IF(selector,'yes','=') evaluates whether the value of selector is equal to 'yes'. In this case, the condition is true. The statement IF(selector,'yes','=') evaluates whether the value of selector is equal to 'yes'. In this case, the condition is true.
@ -36,4 +38,4 @@ The result returned by the API after executing the above code is as follows:
This result indicates that the execution was successful (status:true) and that the value of result is 1. This result indicates that the execution was successful (status:true) and that the value of result is 1.
6.4 Conclusions 6.4 Conclusions
The IF-THEN-ELSE statement in AVAP™ provides an efficient way to make decisions based on specific conditions. Similar to other programming languages, it allows for executing different blocks of code based on the outcome of evaluating a condition. The IF-THEN-ELSE statement in AVAP™ provides an efficient way to make decisions based on specific conditions. Similar to other programming languages, it allows for executing different blocks of code based on the outcome of evaluating a condition.

View File

@ -39,4 +39,4 @@ After executing the above code, the result returned by the API is as follows:
} }
This result confirms that the execution was successful (status:true) and that the final value of counter is 5. This result confirms that the execution was successful (status:true) and that the final value of counter is 5.
In summary, the loop statement in AVAP™ provides an efficient way to execute a block of code repeatedly within a specified range. By automating tasks that require repetition, such as processing a list of items or generating sequential numbers, this statement becomes a fundamental tool for programming in AVAP™. In summary, the loop statement in AVAP™ provides an efficient way to execute a block of code repeatedly within a specified range. By automating tasks that require repetition, such as processing a list of items or generating sequential numbers, this statement becomes a fundamental tool for programming in AVAP™.

View File

@ -12,9 +12,9 @@ Example Usage
Below is a practical example illustrating how to use the addParam() function in an API call: Below is a practical example illustrating how to use the addParam() function in an API call:
# API call with addParam() # API call with addParam()
addParam(user, "john_doe") addParam(user, user_var)
addParam(password, "password123") addParam(password, password_var)
In this example, two parameters, user and password, are being added to an API call. The value of user is set to "john_doe" and the value of password is set to "password123". In this example, two parameters, user and password, are being added to an API call. The value of user is set to user_var and the value of password is set to password_var.
Internal Operation Internal Operation
Internally, the addParam() function constructs the querystring for the API call by adding the specified parameters along with their corresponding values. This querystring is passed to the API, which uses it to process the request and return the appropriate response. Internally, the addParam() function constructs the querystring for the API call by adding the specified parameters along with their corresponding values. This querystring is passed to the API, which uses it to process the request and return the appropriate response.
@ -23,4 +23,4 @@ Important Considerations
It is important to ensure that the parameters added with addParam() are valid and correctly formatted according to the requirements of the API being called. Additionally, it is the developer's responsibility to ensure that the values assigned to the parameters are secure and do not contain malicious data that could compromise system security. It is important to ensure that the parameters added with addParam() are valid and correctly formatted according to the requirements of the API being called. Additionally, it is the developer's responsibility to ensure that the values assigned to the parameters are secure and do not contain malicious data that could compromise system security.
Conclusions Conclusions
The addParam() function in AVAP™ is an essential tool for constructing and managing API calls, facilitating communication between the client and the server. By understanding how this function works and how it is used in the context of an API call, developers can create more robust and secure applications that make the most of web services' potential. The addParam() function in AVAP™ is an essential tool for constructing and managing API calls, facilitating communication between the client and the server. By understanding how this function works and how it is used in the context of an API call, developers can create more robust and secure applications that make the most of web services' potential.

View File

@ -39,4 +39,4 @@ With this understanding of the value and advantages of using includes in AVAP™
Function Libraries Function Products Function Libraries Function Products
In AVAP™, there are a series of function libraries grouped by categories called Function Products that complement the base AVAP™ language and leverage the power of AVS servers for distribution. Through Function Products, developers can extend the functionality of AVAP™ by incorporating specialized libraries tailored to different needs and applications. In AVAP™, there are a series of function libraries grouped by categories called Function Products that complement the base AVAP™ language and leverage the power of AVS servers for distribution. Through Function Products, developers can extend the functionality of AVAP™ by incorporating specialized libraries tailored to different needs and applications.
Function Products provide a way to access advanced features and capabilities not available in the core language, offering a robust framework for building complex and scalable solutions. These libraries are designed to integrate seamlessly with AVAP™, enhancing the development process and enabling more efficient and effective project execution. Function Products provide a way to access advanced features and capabilities not available in the core language, offering a robust framework for building complex and scalable solutions. These libraries are designed to integrate seamlessly with AVAP™, enhancing the development process and enabling more efficient and effective project execution.

View File

@ -3,14 +3,16 @@ Introduction
Functions in AVAP™ are reusable blocks of code that perform a specific task. Just like in Python, functions in AVAP™ allow for code modularization, improved readability, easier maintenance, and code reuse. Functions in AVAP™ are reusable blocks of code that perform a specific task. Just like in Python, functions in AVAP™ allow for code modularization, improved readability, easier maintenance, and code reuse.
Function Construction Function Construction
In AVAP™, similar to Python, functions are defined using the keyword def, followed by the function name and its parameters in parentheses. The function definition ends with a colon (:), followed by the block of code that forms the function body, indented with four spaces. In AVAP™, similar to Python, functions are defined using the keyword function , followed by the function name and its parameters in parentheses. The function definition ends with a {, followed by the block of code that forms the function body, and closed by }.
Defining a function in AVAP™ Defining a function in AVAP™
def greet(name): function greet(name){
return "Hello, " + name + "!" return("Hello, " + name + "!")
}
Calling the function Calling the function
message = greet("World") message = greet("World")
print(message) addResult(message)
Output Output
Hello, World! Hello, World!
Technical Features Technical Features
@ -22,13 +24,16 @@ Practical Example
Below is a practical example illustrating the definition and invocation of a function in AVAP™: Below is a practical example illustrating the definition and invocation of a function in AVAP™:
Definition of a Function to Calculate the Area of a Circle Definition of a Function to Calculate the Area of a Circle
def calculate_circle_area(radius): function calculate_circle_area(radius){
return 3.14 * radius ** 2 return(3.14 * radius ** 2)
}
Calling the Function Calling the Function
circle_radius = 5 circle_radius = 5
area = calculate_circle_area(circle_radius) area = calculate_circle_area(circle_radius)
print("The area of the circle is:", area) result = "The area of the circle is: %s" % area
addResult(result)
Output: Output:
The area of the circle is: 78.5 The area of the circle is: 78.5
Conclusions Conclusions
Functions are a fundamental part of programming in AVAP™, allowing for effective organization and modularization of code. By understanding how to define, construct, and call functions in AVAP™, developers can write clearer, more concise, and maintainable code, facilitating the development and management of applications. Functions are a fundamental part of programming in AVAP™, allowing for effective organization and modularization of code. By understanding how to define, construct, and call functions in AVAP™, developers can write clearer, more concise, and maintainable code, facilitating the development and management of applications.

View File

@ -1,4 +1,3 @@
Appendix
Function Glossary Function Glossary
randomString() randomString()
The randomString() command generates a random string based on a specified pattern and stores it in a target variable. It is especially useful when random strings are needed to conform to a specific format, such as passwords or identifiers. The randomString() command generates a random string based on a specified pattern and stores it in a target variable. It is especially useful when random strings are needed to conform to a specific format, such as passwords or identifiers.
@ -718,4 +717,4 @@ functionAI(prompt, source, averageSalary)
// Return the result of the function via addResult // Return the result of the function via addResult
addResult(averageSalary) addResult(averageSalary)
In this example, the functionAI() command will convert the prompt into a code implementation to calculate the average of the salary column in the employees table. The result of the calculation will be stored in the averageSalary variable, and this variable will be returned via addResult(averageSalary). The output will be the calculated average of the salary column. In this example, the functionAI() command will convert the prompt into a code implementation to calculate the average of the salary column in the employees table. The result of the calculation will be stored in the averageSalary variable, and this variable will be returned via addResult(averageSalary). The output will be the calculated average of the salary column.

View File

@ -45,4 +45,4 @@ The language also includes the capability to interact with databases using natur
With this guide, we hope to provide you with all the necessary information to make the most of this dynamic language's capabilities. From variable management to automated result generation and simplified database access, this language is designed to transform the way you develop APIs. With this guide, we hope to provide you with all the necessary information to make the most of this dynamic language's capabilities. From variable management to automated result generation and simplified database access, this language is designed to transform the way you develop APIs.
1.5 Conclusions 1.5 Conclusions
The virtuality attribute in AVAP™ represents an innovative approach to virtual API development, allowing for greater flexibility, agility, and simplification in the software development and maintenance process. By decoupling language specifications from the interpreter and enabling dynamic code construction in real-time, AVAP™ offers a new paradigm in API design and management. The virtuality attribute in AVAP™ represents an innovative approach to virtual API development, allowing for greater flexibility, agility, and simplification in the software development and maintenance process. By decoupling language specifications from the interpreter and enabling dynamic code construction in real-time, AVAP™ offers a new paradigm in API design and management.

View File

@ -30,10 +30,12 @@ AVAP™ offers a wide range of features that promote flexibility in programming.
# Example of a higher-order function # Example of a higher-order function
def operation(func, a, b): function operation(func, a, b){
return func(a, b) return(func(a, b))
def add(x, y): }
return x + y function add(x, y){
return(x + y)
}
result = operation(add, 3, 5) result = operation(add, 3, 5)
# The add function is passed as an argument # The add function is passed as an argument
@ -45,4 +47,4 @@ Faster writing and execution of code.
Facilitates experimentation and exploration of solutions. Facilitates experimentation and exploration of solutions.
Allows for rapid feedback during development. Allows for rapid feedback during development.
1.3 Summary 1.3 Summary
AVAP™ is a dynamic programming language that offers a wide range of features promoting flexibility, adaptability, and speed in application development. With its dynamic typing, automatic memory management, runtime interpreter, and programming flexibility, AVAP™ becomes a powerful and versatile tool for developers. AVAP™ is a dynamic programming language that offers a wide range of features promoting flexibility, adaptability, and speed in application development. With its dynamic typing, automatic memory management, runtime interpreter, and programming flexibility, AVAP™ becomes a powerful and versatile tool for developers.

View File

@ -63,10 +63,11 @@ Practical Example
example_variable = 10 example_variable = 10
// Definition of a function // Definition of a function
example_function(parameter): function example_function(parameter){
// Function body // Function body
result = parameter * 2 result = parameter * 2
return result return(result)
}
// Function call // Function call
result = example_function(example_variable) result = example_function(example_variable)
@ -75,4 +76,4 @@ In this example, notation conventions are used to define a variable, a function,
Conclusions Conclusions
Notation in AVAP™ is a fundamental part of software development in the language. By following clear and consistent notation conventions, developers can write and maintain code more effectively, contributing to the readability, understanding, and maintainability of the code in projects of any size and complexity. Notation in AVAP™ is a fundamental part of software development in the language. By following clear and consistent notation conventions, developers can write and maintain code more effectively, contributing to the readability, understanding, and maintainability of the code in projects of any size and complexity.
With this understanding of notation in AVAP™, developers can write clean and structured code that is easy to understand and maintain over time. With this understanding of notation in AVAP™, developers can write clean and structured code that is easy to understand and maintain over time.

View File

@ -54,9 +54,10 @@ Below is a practical example that illustrates lexical analysis in AVAP™:
// Function definition // Function definition
function_example(parameter): function function_example(parameter){
result = parameter * 2 result = parameter * 2
return result return(result)
}
// Function call // Function call
value = function_example(10) value = function_example(10)
@ -71,4 +72,4 @@ parameter, result, value: Variable identifiers.
Conclusions Conclusions
Lexical analysis is a crucial step in the compilation or interpretation of a program in AVAP™. By breaking down the source code into tokens, it lays the foundation for subsequent syntactic and semantic analysis, allowing the program to be correctly understood and executed by the interpreter or compiler. Lexical analysis is a crucial step in the compilation or interpretation of a program in AVAP™. By breaking down the source code into tokens, it lays the foundation for subsequent syntactic and semantic analysis, allowing the program to be correctly understood and executed by the interpreter or compiler.
With a clear understanding of lexical analysis in AVAP™, developers can write clean and structured code, facilitating the software development process in the language. With a clear understanding of lexical analysis in AVAP™, developers can write clean and structured code, facilitating the software development process in the language.

View File

@ -34,15 +34,15 @@ Below is a practical example that illustrates the use of the data model in AVAP
example_list = [1, 2, 3, 4, 5] example_list = [1, 2, 3, 4, 5]
# Accessing individual elements # Accessing individual elements
print(example_list[0]) # Output: 1 addResult(example_list[0]) # Output: 1
# Slicing to get a sublist # Slicing to get a sublist
sublist = example_list[2:4] sublist = example_list[2:4]
print(sublist) # Output: [3, 4] addResult(sublist) # Output: [3, 4]
# List methods # List methods
example_list.append(6) example_list.append(6)
print(example_list) # Output: [1, 2, 3, 4, 5, 6] addResult(example_list) # Output: [1, 2, 3, 4, 5, 6]
Conclusions Conclusions
The data model in AVAP™ provides a flexible and dynamic structure for working with data in the language. By understanding the available data types, data structures, operations, and methods, developers can write efficient and effective code that manipulates and processes data effectively. The data model in AVAP™ provides a flexible and dynamic structure for working with data in the language. By understanding the available data types, data structures, operations, and methods, developers can write efficient and effective code that manipulates and processes data effectively.

View File

@ -59,4 +59,4 @@ text1 = "Hello"
text2 = "world" text2 = "world"
concatenation = text1 + " " + text2 concatenation = text1 + " " + text2
1.4 Summary 1.4 Summary
Data types in AVAP™ are fundamental for program development. They allow for the storage and manipulation of different types of values, such as numbers, text, and truth values. With a solid understanding of data types and how they are used in program development, developers can create robust and functional applications in AVAP™. Data types in AVAP™ are fundamental for program development. They allow for the storage and manipulation of different types of values, such as numbers, text, and truth values. With a solid understanding of data types and how they are used in program development, developers can create robust and functional applications in AVAP™.

View File

@ -35,10 +35,10 @@ value is the initial value to be assigned to the variable.
2.3.3 Direct Initialization 2.3.3 Direct Initialization
It is also possible to declare and initialize a global variable at the same time using the following syntax: It is also possible to declare and initialize a global variable at the same time using the following syntax:
global variable_name=value addVar(variable_name,value)
Where: Where:
variable_name is the name of the variable to be declared. variable_name is the name of the variable to be declared.
value is the initial value to be assigned to the variable, which automatically defines the variable's type. value is the initial value to be assigned to the variable, which automatically defines the variable's type.
2.4 Summary 2.4 Summary
Working with variables in AVAP™ is essential for developing efficient and scalable applications. Variables allow for storing and manipulating data during program execution, which facilitates calculations and communication between different parts of the program. With a solid understanding of variable types and the different ways to declare them in AVAP™, developers can create robust and functional applications. Working with variables in AVAP™ is essential for developing efficient and scalable applications. Variables allow for storing and manipulating data during program execution, which facilitates calculations and communication between different parts of the program. With a solid understanding of variable types and the different ways to declare them in AVAP™, developers can create robust and functional applications.

View File

@ -37,4 +37,4 @@ Keep comments updated as the code evolves.
Write clear and concise comments that are easy for other developers to understand. Write clear and concise comments that are easy for other developers to understand.
Avoid redundant or unnecessary comments that do not provide useful information to the reader. Avoid redundant or unnecessary comments that do not provide useful information to the reader.
3.5 Summary 3.5 Summary
Comments in AVAP™ are an essential tool for improving the readability and maintainability of source code. With line comments, block comments, and documentation comments, developers can add explanations, clarifications, and useful documentation to the code, making it easier to understand and collaborate within development teams. Comments in AVAP™ are an essential tool for improving the readability and maintainability of source code. With line comments, block comments, and documentation comments, developers can add explanations, clarifications, and useful documentation to the code, making it easier to understand and collaborate within development teams.

View File

@ -50,4 +50,4 @@ total = sum(numbers) // Output: 15
// Checking if a number is present in the list // Checking if a number is present in the list
is_present = 6 in numbers // Output: False is_present = 6 in numbers // Output: False
Conclusions Conclusions
Expressions in AVAP™ are a fundamental part of programming, allowing for a wide variety of data operations and manipulations. By understanding the different types of expressions and operators, as well as working with data structures such as lists, developers can write clear and effective code that meets the program's requirements. Expressions in AVAP™ are a fundamental part of programming, allowing for a wide variety of data operations and manipulations. By understanding the different types of expressions and operators, as well as working with data structures such as lists, developers can write clear and effective code that meets the program's requirements.

View File

@ -33,10 +33,7 @@
"OLLAMA_URL = os.getenv(\"OLLAMA_URL\")\n", "OLLAMA_URL = os.getenv(\"OLLAMA_URL\")\n",
"OLLAMA_LOCAL_URL = os.getenv(\"OLLAMA_LOCAL_URL\")\n", "OLLAMA_LOCAL_URL = os.getenv(\"OLLAMA_LOCAL_URL\")\n",
"OLLAMA_MODEL_NAME = os.getenv(\"OLLAMA_MODEL_NAME\")\n", "OLLAMA_MODEL_NAME = os.getenv(\"OLLAMA_MODEL_NAME\")\n",
"OLLAMA_EMB_MODEL_NAME = os.getenv(\"OLLAMA_EMB_MODEL_NAME\")\n", "OLLAMA_EMB_MODEL_NAME = os.getenv(\"OLLAMA_EMB_MODEL_NAME\")"
"\n",
"config = AutoConfig.from_pretrained(HF_EMB_MODEL_NAME)\n",
"embedding_dim = config.hidden_size"
] ]
}, },
{ {
@ -222,7 +219,7 @@
}, },
{ {
"cell_type": "code", "cell_type": "code",
"execution_count": 7, "execution_count": null,
"id": "8e214f79", "id": "8e214f79",
"metadata": {}, "metadata": {},
"outputs": [], "outputs": [],
@ -263,7 +260,7 @@
"\n", "\n",
"\n", "\n",
"chunks = build_chunks_from_folder(\n", "chunks = build_chunks_from_folder(\n",
" folder_path=\"/home/acano/PycharmProjects/assistance-engine/data/raw/docs\"\n", " folder_path=\"/home/acano/PycharmProjects/assistance-engine/ingestion/docs\"\n",
")" ")"
] ]
}, },

File diff suppressed because one or more lines are too long