From: Brendan Hansen Date: Mon, 30 Aug 2021 20:06:22 +0000 (-0500) Subject: added unfinished examples X-Git-Url: https://git.brendanfh.com/?a=commitdiff_plain;h=ebb4b2bc9b938bca7a909659b9e6e090567f84e2;p=onyx.git added unfinished examples --- diff --git a/.gitignore b/.gitignore index c8c3717e..327f4936 100644 --- a/.gitignore +++ b/.gitignore @@ -12,3 +12,4 @@ session.vim *.exe *.rdbg tmp/ +.vimspector.json diff --git a/examples/18_macros.onyx b/examples/18_macros.onyx new file mode 100644 index 00000000..32e750e1 --- /dev/null +++ b/examples/18_macros.onyx @@ -0,0 +1,20 @@ +// Unfinished Example + +#load "core/std" + +use package core + +say_something :: macro (thing: Code) { + #persist increment := 0; + increment += 1; + printf("[INFO:{}] {}\n", increment, #insert thing); +} + +main :: (args: [] cstr) { + data := "Some string in the main function"; + + say_something(#code "Foo"); + say_something(#code 10); + say_something(#code context); + say_something(#code data); +} diff --git a/examples/19_do_blocks.onyx b/examples/19_do_blocks.onyx new file mode 100644 index 00000000..d1f648b4 --- /dev/null +++ b/examples/19_do_blocks.onyx @@ -0,0 +1,9 @@ +// Unfinished Example + +#load "core/std" + +use package core + +main :: (args: [] cstr) { + +} diff --git a/examples/20_auto_return.onyx b/examples/20_auto_return.onyx new file mode 100644 index 00000000..d1f648b4 --- /dev/null +++ b/examples/20_auto_return.onyx @@ -0,0 +1,9 @@ +// Unfinished Example + +#load "core/std" + +use package core + +main :: (args: [] cstr) { + +} diff --git a/examples/21_quick_functions.onyx b/examples/21_quick_functions.onyx new file mode 100644 index 00000000..0c9f08b4 --- /dev/null +++ b/examples/21_quick_functions.onyx @@ -0,0 +1,9 @@ +// Unfinished Example + +#load "core/std" + +use package core + +main :: (args) => { + +}