From 2154b055e96d571810a3cd1f595ab5d3952b1573 Mon Sep 17 00:00:00 2001 From: xerox Date: Sun, 7 Jun 2020 11:26:23 +0000 Subject: [PATCH] Update README.md --- README.md | 66 +++++++++++++++++++++++-------------------------------- 1 file changed, 27 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index a74b26a..1ba12aa 100755 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# Eon programming language V0.9.6 +# Eon programming language V0.9.6.1 My computer programming language made with LEX/YACC written in C. (interpreted) # Downloads @@ -8,11 +8,10 @@ Supports both linux and windows, download link for current build can be found he Hello world in Eon. ```c -def main: +__main: { print["hello world"]; }; -call main; ``` # Variables @@ -52,35 +51,24 @@ call main; ``` # Scope -* As of v0.9.5 there is not scope inside of this programming language. +* As of v0.9.6.1 there is scope, but the scope is limited to functions. Anything inside of a function is accessable anywhere inside of that function. ```c -/* changes var from 10 to 100 */ -def another_function: -{ - var = 100; +def test[a]: { + if[a]: { print[a]; }; }; -def main: -{ - var = 10; - /* should print 10 */ - print[var]; - call another_function; - /* should print 100 */ - print[var]; -}; -call main; +__main: { var = 10; print[var]; call test[var]; }; ``` # Logic -* As of version 0.9.5, logic conditions must only be variables. +* As of version 0.9.5, logical conditions will evaluate the provided variable. ### If statements ```c -def main: +__main: { var = 1; if[var]: /* condition must be a variable */ @@ -90,10 +78,9 @@ def main: }; if[var]: { - print["this wont print! (or shouldnt)"]; + print["this wont print!"]; }; }; -call main; ``` ### While loops @@ -114,31 +101,32 @@ call main; # Functions * Functions can be defined as variables (lambda) or defined normally. - +* Functions support parameters of any amount. ```c -def my_function: +def my_function[a, b, c, d]: { some_function = { print["hello world"]; }; call some_function; -}; -call my_function; -``` - -# Redefinitions -* As of v0.9.5 everything in this programming language can be redefined. That means everything, including the function that -is currently being executed. - -```c -def main: -{ - main = { - print["i just redefined main"]; + + if[a]: + { + if[b]: + { + print[c]; + print[d]; + }; }; }; -call main; -call main; +__main: +{ + var = 1; + test_string = "hello world"; + + call my_function[var, var, test_string, test_string]; +}; ``` +