Releases: 2105789/Lango
1.5
Lango Interpreter - Major Feature Update: Functions, Classes, and Arrays!
Lango Interpreter - Major Feature Update: Functions, Classes, and Arrays!
This release marks a significant milestone for the Lango interpreter, introducing several fundamental features that greatly enhance the language's capabilities and expressiveness:
-
First-Class Functions:
- Define functions using the
funkeyword. - Functions are first-class citizens: they can be assigned to variables, passed as arguments, and returned from other functions.
- Support for closures: inner functions capture variables from their enclosing scopes.
- Explicit
returnstatements allow functions to produce values.
- Define functions using the
-
Basic Classes and Objects:
- Define classes using the
classkeyword. - Declare methods (functions defined within a class).
- Instantiate classes to create objects (e.g.,
MyClass()). - Access and assign object properties using dot (
.) notation (e.g.,instance.property,instance.property = value). - Methods automatically have access to the instance via the
thiskeyword.
- Define classes using the
-
Arrays (Lists):
- Create array literals using square brackets
[](e.g.,[1, "a", true]). - Access elements using zero-based indexing (e.g.,
myArray[0]). - Assign new values to array elements (e.g.,
myArray[1] = newValue).
- Create array literals using square brackets
Summary:
With the addition of functions, basic object-oriented programming via classes, and dynamic arrays, Lango is evolving into a much more powerful and versatile scripting language. These features provide essential tools for building more complex and structured programs.
Refer to the updated README.md for syntax examples and the comprehensive test_script.lango to see these features in action.
Initial Build
Execute
langoc filename.lango
For executing a program file.
OR
lango
For line by line execution.