A small update.
This commit is contained in:
parent
9e79438e04
commit
27e96c1600
3 changed files with 17 additions and 5 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -0,0 +1 @@
|
||||||
|
tmp/
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
# Fun
|
# Fun
|
||||||
|
|
||||||
Fun Uses Nothing - The programming language for having fun.
|
Fun Uses Nothing - Life is too short not to code fun... ;)
|
||||||
|
|
||||||
Influenced by C, Go, Lua, Python and Rust.
|
Influenced by C, Go, Lua, Python and Rust.
|
||||||
|
|
||||||
|
|
|
||||||
19
draft.fun
19
draft.fun
|
|
@ -42,7 +42,10 @@
|
||||||
// Includes from a system installed file. Included libs should support the
|
// Includes from a system installed file. Included libs should support the
|
||||||
// extension .so and the .fun extension for core libraries implemented in fun,
|
// extension .so and the .fun extension for core libraries implemented in fun,
|
||||||
// but can be included without the extension. This directory must support
|
// but can be included without the extension. This directory must support
|
||||||
// subdirectories. The root for this diretory is e.g. /var/lib/fun/.
|
// subdirectories. The root for this diretory is e.g. /var/lib/fun/. A file
|
||||||
|
// named fun.so and fun.fun can reside here, but the .fun file will be included
|
||||||
|
// here; The .fun file can then include a .so file with the same name, but then
|
||||||
|
// extension .so is required.
|
||||||
// Some examples:
|
// Some examples:
|
||||||
#include crypt/md5
|
#include crypt/md5
|
||||||
#include crypt/sha256
|
#include crypt/sha256
|
||||||
|
|
@ -50,7 +53,7 @@
|
||||||
#include math
|
#include math
|
||||||
// Files can be included with or without the extension.
|
// Files can be included with or without the extension.
|
||||||
#include native/lib.fun
|
#include native/lib.fun
|
||||||
#include native/std.so
|
#include std.so
|
||||||
#include network
|
#include network
|
||||||
#include process
|
#include process
|
||||||
#include socket
|
#include socket
|
||||||
|
|
@ -88,13 +91,21 @@ byte todd = 42
|
||||||
|
|
||||||
float new_float = 0.12345
|
float new_float = 0.12345
|
||||||
|
|
||||||
// Global variables can be used everywhere in the code. Even in in cluded files.
|
// Global variables can be used everywhere in the code. Even in included files.
|
||||||
global string a_string = 'Hello'
|
// It should be possible to use ' and ", but ' has higher priority so " can be
|
||||||
|
// used inside '.
|
||||||
|
global string a_string = "Hello"
|
||||||
global string b_string = 'World!'
|
global string b_string = 'World!'
|
||||||
|
|
||||||
|
// This produces: Hello World!
|
||||||
string x_string = a_string + " " + b_string
|
string x_string = a_string + " " + b_string
|
||||||
|
// This produces: Hello World!
|
||||||
string y_string = a_string + ' ' + b_string
|
string y_string = a_string + ' ' + b_string
|
||||||
|
// This produces: Hello " " World!
|
||||||
string z_string = a_string + '" "' + b_string
|
string z_string = a_string + '" "' + b_string
|
||||||
|
// This produces an error.
|
||||||
|
string z_string = a_string + "' '" + b_string
|
||||||
|
|
||||||
|
|
||||||
// 64 bit number
|
// 64 bit number
|
||||||
number foo = 23
|
number foo = 23
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue