Updated examples and README to use proper syntax

This commit is contained in:
2021-01-12 17:49:16 -06:00
parent ab86e19cfe
commit 32162ce50c
4 changed files with 15 additions and 14 deletions

View File

@@ -1,7 +1,7 @@
# Cosmo
Cosmo is a portable scripting language loosely based off of Lua. Cosmo easily allows the user to extend the language through the use of Proto objects, which describe the behavior of Objects. For example the following is a simple Vector Proto which describes behavior for a Vector-like object.
```
```lua
proto Vector
function __init(self)
self.vector = []
@@ -24,11 +24,11 @@ end
var vector = Vector()
for (var i = 0; i < 4; i++) do
vector.push(i)
vector:push(i)
end
for (var i = 0; i < 4; i++) do
print(vector.pop() .. " : " .. vector[i])
print(vector:pop() .. " : " .. vector[i])
end
```