<<<<<<< HEAD Strives to be comment free of explaining comments by use of titled, readable, clean code.
(Lua + C-like languages + Python)
A programming language concept.
a9ed4bc55450f5eef03cbec7e68a3fa25e8042ca
- Typed Language
- High Readability
- Classless but with Instances and Constructors
- Built-in enum, overloading, fractions and more
run xyz {
...
}
Basically a self-ran, zero-argument function
Used for:
- Titling a block of code and seeing exactly what it applies to (unlike a comment would).
- Allows for less explaining comments by having titled sections of code, making everything more readable.
- Repeating code-blocks without arguments.
- Making a function, would require you to call it after you make it.
Can be ran again if needed by run xyz
(not a real function so xyz()
won't work)
Multiply numbers and variables next to eachother using parentheses.
2(2) => 4
5(3 + 2) => 25
x = 5
2(x) => 10
Organize and group functions and other variables.
namespace getMax {
health() -> Number {
...
}
stamina() -> Number {
...
}
}
getMax.stamina()
Store empty values.
enum Color {
RED,
BLUE
}
local Color x = Color.RED
local Fraction half = 1/2
half + 1/4 = 3/4
x(Number a, String b) -> Number {
...
}
Notice the difference in =>
and ->
x(Number a, String b) => 1 {
return 1
}
local number a = 5
local string b = "Hello, world!"
global string c = "I am everywhere"
// This is a comment.
instance = Instance()
instance._name = "Cleo"
instance.age = 6
instance.hello() {
print("hi")
}
property instance.name {
setter [string new_name] {
instance._name = new_name
}
getter -> string {
return instance._name.lower()
}
}
instance.name => cleo
+[instance, number addend] -> number {
return instance.age + addend
}
instance + 5 => 11
overload +[instance, string addend] -> number {
return instance.name + addend
}
instance + "n" => "cleon"
Animal(string name, number age) -> [Animal] {
instance = Instance()
instance.name = name
instance.age = age
instance.cry() {
print("asdf")
}
return instance
}
local Cat = Animal("Cleo", 6)
namespace Animal {
createNewborn(string name) -> Animal {
return Animal(name, 0)
}
}
local Cat = Animal("Cleo", 6)
Dog(string name, number age, string species) -> [Dog] {
instance = Animal(name, age)
instance.species = species
instance.cry() {
print("woof")
}
return instance
}
local Doggie = Dog("Doggie", 2, "German Shepard")
namespace Dog inherits Animal
Dog.createNewborn("Baby")
namespace
inheirts
local
global
overload
property
getter
setter
enum
run
->
Returning a type-> [X]
Returning a new type of Instance calledX
=>
Returning literal valuesx[]
Implict Arguments (Only for Math Operations and setter right now:x + y
->+[x, y]
,x.name = y
->setter [y] {...}
){}
Bounds of Contents / Indentation / New Scope//
Comments"""
Multi-line Comments#
Get length of()
Calling Function""
Strings
- string
- number
- fraction
- Instance
- Arrays
- Loops
- Automatically assign types when first init a variable?