Hello, World!
This session demonstrates how to use Yet Another Language's Integrated Programing Environment, how to TERMINATE or quit Yet Another Language, how to force to abort program execution. Download and open the sample.
Variable Declaration for Type Integer number
This session demonstrates how to declare primitive data types (integer). And assign literal integer value to a variable, and do simple calculation, then print out the result to Output window. Keywords integer and clear is introduced. Download and open this sample.
Variable Declaration for Type Real number
This session demonstrates how to use real (or floating-point ) numbers. Keyword real is introduced. Download and open this sample.
Variable Declaration for Type Complex number
This session demonstrates how to use complex numbers. Keyword complex is introduced. Complex numbers are built-in data type in Yet Another Language (or simply YAL). Download and open this sample.
Variable Declaration for Type Vector
This session demonstrates how to use 3D vectors. Keyword vector is introduced. 3D vectors are built-in data type in YAL. Cross product of two vectors and scalar product of two vectors are demonstrated. Download and open this sample. Download and open this sample.
Variable Declaration for Type String
This session demonstrates how to use strings. Keyword string is introduced. Strings are very simple to use in YAL. Download and open this sample.
Variable Declaration for Type Boolean
This session demonstrates how to declare boolean variables, boolean literals (true or false). Keyword bool, true, and false are introduced. Pre-defined "Yes" or "No" prompt dialog box function, bool yesno(string), is introduced. Download and open this sample.
Variable Declaration - Advanced
This session demonstrates how to declare multiple variables with multiple data types in a single line of code. Multiple data types along with strings can be chained to be printed in the Output window. Download and open this sample.
Declaration for literal variable and Prompt User to Input Values
This session demonstrates how to declare literal variable which are evaluated at compile-time (or parsing time). This session also introduces how to prompt user to input value at run-time. Download and open this sample.
Boolean Operators and Expression
This session demonstrates operators for boolean expressions. Without boolean expressions, any programming languages are meaningless. Download and open this sample.
If, If-Else Construct
This session demonstrates how to use conditional branch for program executions with if, if-else construct. If, if-else, if_true, if_false, if_true - else_false, if_false - else_true keywords are introduced. Download and open this sample.
For Loop Construct
This session demonstrates how to use for loop. The syntax of for-loop is very rich in YAL. Keyword for and break are introduced. Download and open this sample.
Do Loop Construct
This session demonstrates how to use do-loop construct. do-loop is sometimes very handy for alternative. Keyword do, break, and continue are introduced. Download and open this sample.
While Loop Construct
This session demonstrates how to use while-loop construct. It is another kind of loop. Download and open this sample.
Keyword Static
This session demonstrates how to use static local variable. When local variables are used in the loop constructs (for, do, while, etc.), static keyword plays a vital role. Download and open this sample.
Static Member Function
This session demonstrates how to use static member function of a class (or user-defined data type). This session also introduces keyword class do declare user-defined data types. Download and open this sample.
Select Construct
This session demonstrates how to use select, choice, always construct. Keyword select, choice, default, and break are introduced. Download and open this sample.
Array in YAL
This session demonstrates how to declare array of type integer. Also integer random number generation function, integer irandom (integer, integer), is introduced. Download and open this sample.
Member functions for Array
This session demonstrates member functions for array. Resize() member function is used to change array elements count, and size() member function is used to know array element count. Download and open this sample.
2-Dimensional Array
This session demonstrates how to use 2 dimensional array. Two dimensional arrays are the basis for linear algebra. Download and open this sample.
Array Initialization
This session demonstrates how to initialize arrays. When array initialization is used with functional expressions, it becomes a very powerful means for advanced linear algebraic computations. Download and open this sample.
Operators for Arrays
This session demonstrates how to use operators for arrays. YAL has rich set of operators specifically designed for array manipulation. Keyword goto is introduced along with goto target labels. And numerical solution algorithm detcramer (determinant using cramer's rule) is introduced. Download and open this sample.
Goto Construct
This session demonstrates how to use goto construct along with labels. In this session, expression of type string is used in the place of boolean expression to prompt user to say "yes" or "no" at run-time. Download and open this sample.
Prompt User to Input Values
This session demonstrates how to prompt users to input values for variables at run-time. How to access member variable of a class is also demonstrated. Download and open this sample.
Force to Abort
This session demonstrates how to force to abort program execution. When the program appears never-ending, we may need to stop the program execution by force. In such case, this session may help you. Download and open this sample.
String Expressions in the Place of Boolean Expression
This session demonstrates how to use expressions of type string in the place of boolean expressions. It is pretty handy way to prompt user for actions. Keyword goto along with labels are also introduced. Download and open this sample.
Simple Functional Expressions
This session demonstrates functional expressions. Keywords fmt_precision and literal are also introduced. Pre-defined Math class' pi literal is introduced and built-in functions, real sin (real), and complex cosc (complex), are also introduced. Download and open this sample.
Functional Expressions for Array
This session demonstrates functional expressions for use with arrays. Functional expressions for real number matrix (2-dimensional array of type real) and complex matrix (2-dimensional array of type complex) are introduced. Also system built-in functions, real sin ( real ), real cos (real ), real tan ( real ), complex cosc ( complex ), complex sinc ( complex ), complex sqrtc ( complex ), complex tanc ( complex), etc. are introduced. Download and open this sample.
Swapping Operator <=>
This session demonstrates swapping operator <=> . This operator is pretty handy when we want to swap two values of two variables of same type. When the contents of two arrays or user-defined objects, this operator is really good. Keyword new and delete are introduced for dynamic allocation and de-allocation. Download and open this sample.
Solve Equations
This session demonstrates functional expression along with equation solving method. When functional expressions are combined with matrix (2-dimensional arrays), it becomes foundation for advanced algebraic computation. Download and open this sample.
Assignment Operators
This session demonstrates assignment operators. In YAL, assignments are regarded as statements, and can NOT be passed as function arguments. And post-fix increment operator (++) is the same to pre-fix increment operator, in the same manner, post-fix decrement operator ( -- ) is same to pre-fix decrement operator. Download and open this sample.
Operator Precedence
This session demonstrates operator precedence. Operators in YAL take their usual precedence as defined in mathematics. However, special attention should be paid to power operator ^, whose association is right to left, and takes highest precedence. Download and open this sample.
Pointer, Try-Catch-Throw Construct
This session demonstrates how to define a function to take pointers as its arguments. Keywords try, catch, and throw are introduced. Download and open this sample.
Dynamic Memory Allocation
This session demonstrates dynamic memory allocation. Keywords new and delete are introduced. Dynamic memory allocation for user-defined type is still EXPERIMENTAL, and you should use it at your own risk. Download and open this sample.
Operators for Integer
This session demonstrates operators for integer data type. Operators for factorial, permutation, combination, greatest common divisor, least common multiple, etc. are built-in operators for integer expressions. Download and open this sample.
Ternary Operator
As in C language, ternary operator ? is implemented in YAL. Download and open this sample.
Function (Basic)
This session demonstrates how to define functions in YAL. As in C language, functions in YAL are able to be defined recursively. Download and open this sample.
Keyword Declare
This keyword is introduce to YAL to enable recursive function-call. When we want to call a function whose body is not yet defined, we can declare function header (or signature), then call the function. Its body can be defined later in the code. Download and open this sample.
Local Function
This session demonstrates how to define local functions (i.e. functions defined inside of another function), and use them. Local functions are not supported in C language. Simply put, local functions are functions defined inside of another function body. Download and open this sample.
Function Argument Evaluation Order
This session demonstrates function argument evaluation order. When several expressions are passed to a function, those expressions are evaluated from left to right. Download and open this sample.
Try-Catch-Thow Construct (Basic)
This session demonstrates try-catch, throw constructs. Keywords, try, catch, and throw are introduced. Download and open this sample.
Pointer and Try-Catch
This session continues previous session and demonstrates how to use pointers along with try-catch construct. De-reference operator * (star) is also introduced. Download and open this sample.
Try-Catch with User-Defined Type
This session continues previous session and demonstrates how to use user-defined data type along with try-catch construct. Pointers to user-defined type is introduced. Note that de-reference operator is not need when accessing members using pointer to user-defined data type. Download and open this sample.
Pre-defined class Complex
This session demonstrates how to use pre-defined class Complex which is defined in the file Library\Complex.yal Using class Complex, you can set and retrieve complex numbers in polar-coordinate form. Keyword include is introduced. Download and open this sample.
Operators for Complex Numbers
This session demonstrates operators specifically designed for complex numbers. System built-in functions, real deg( real ), real rad (real ), and a lot other useful operators for complex numbers are introduced. Download and open this sample.
Keyword ucplx
This session demonstrates how to use keyword ucplx, i.e. Unit Complex. This keyword is handy when you want to change real and imaginary operators for complex numbers. Download and open this sample.
Operators for Vector
This session demonstrates how to use operators specifically designed for vectors. Operators such as cross product, dot product, addition of two vectors, subtraction of two vectors, scalar multiple of a vector, magnitude of a vector, operator for unit vector are all introduced here. Download and open this sample.
Keyword uvctr
This session demonstrates how to use keyword uvctr, i.e. Unit Vector. This keyword is handy when you want to change x, y, and z component of unit vectors. Download and open this sample.
Pre-defined class Vector
This session demonstrates how to use pre-defined Vector class which is defined in Library\Vector.yal. To use pre-defined Vector class, you should explicitly include Vector.yal in your code file. Using this class, you can set and retrieve vectors in spherical and cylindrical coordinates format. Download and open this sample.
Equation Solutions and Extrama
This session demonstrates how to solve single variable equations and how to get extrema (minima and maxima) using system built-in method. Functional expressions are introduced here again. Download and open this sample.
Inverse Matrix
This session demonstrates how to get inverse matrix of 2-D square matrix. Numerical solution operator ?? and keyword inverse are introduced. Download and open this sample.
Coefficients of a Complex Characteristic Equation
This session demonstrates how to compute coefficients of a complex characteristic equation. When functional expressions of complex are used with 2-dimensional complex array, it becomes a very powerful tool for complex analysis. Numerical solution operator ?? and keywords detcramer and solvecramer are introduced. Download and open this sample.
Eigen Value Problem
This session demonstrates how to use functional expressions for two dimensional matrix, numerical solution operator ??, keywords, detcramer and solvecramer, and equation solution method to compute characteristic equation, then compute eigen values. In this session, you can enjoy the power of Yet Another Language. Keyword, fmt_precision is introduced. Download and open this sample.
User-Defined Type, Class
This session formally introduces keyword class for user-defined data type. This feature is still experimental but will be fully implemented in the next version of the software. Download and open this sample.
Sub-Class
This session demonstrates how to define sub-class, i.e. the class defined inside of another class. Download and open this sample.
Local Class
This session demonstrates how to define local class, i.e., class defined inside of another function. Download and open this sample.
Static Member Function
This session demonstrates static member function. i.e. a member function that can NOT access member variable. But static functions can sometimes be very handy tool. Download and open this sample.
Literal Data Member
This session demonstrates how to use literal data members. Literal data members are sometimes very handy. For example, class Math defines a number of mathematical constants such as pi, e, etc. By allowing literal data member, we can avoid name-conflicts. Download and open this sample.
YAL is not C language
This session explains the major differences between YAL and C language. Dangling expressions are NOT allowed in YAL. And assignments are statements and can NOT be passed as function arguments. And post-fix and pre-fix operators are the same and identical in its operation. Download and open this sample.
Thousand Delimiter and Scientific Notation
This session explains thousand delimiters and scientific notation for floating-point numbers (or real numbers). Download and open this sample.
Keyword include
This session demonstrates how to use keyword include. As in C language, you can define classes in another file, and include that file(s) into your current code. Pre-defined classes, Math (defined in Mathematics.yal) and Physics (defined in Physics.yal) are automatically included and parsed when you startup YAL. Download and open this sample.
Keyword exit
This session demonstrates how to use keyword exit. As it means, this keyword forces to abort program execution programmatically. Download and open this sample.
Create Your Own Class Library
This session explains program startup code, startup.yal and how to create your own class library. When you start up YAL, startup.yal is loaded and parsed automatically. If you want your own libraries be parsed at startup, you can open and edit startup.yal which is in the application root folder, then click "Reload Startup Program" button in the Yet Another Language ribbon.
Translate Keywords into your Mother Tongue
Yet Another Language is developed 100% in UNICODE from ground-up and supports all kinds of human languages in the world (?, at least I hope so). This session demonstrates how to translate keywords and extend YAL to your mother tongue. Keywords in YAL are both translatable and extendable to any language as long as UNICODE system supports the language.