Skip to content

Commit bc91e79

Browse files
committed
guide update
1 parent beeb503 commit bc91e79

File tree

1 file changed

+44
-1
lines changed

1 file changed

+44
-1
lines changed

README.md

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,48 @@ RoyalScript is a functional programming languag that aims to combine the utility
66

77
##Computational Functions
88

9-
The major difference between RoyalScript and other functional languags lik Scheme is that RoyalScript functions do not *always* evaluate to some resulting value.
9+
The major difference between RoyalScript and other functional languags lik Scheme is that RoyalScript functions do not *always* evaluate to some resulting value. They do not always return a value. Some functions, such as the `for` function loops over some list of values. Another example is the
10+
11+
RoyalScript is meant to offer more options for computation than just recursion, although recursion is definitely usable.
12+
13+
In fact, every RoyalScript program must have at least one or more functions, otherwise you will raise an error.
14+
15+
##Syntax
16+
17+
In RoyalScript, all statements abide by a concise function syntax as follows
18+
19+
```
20+
<FUNCTION>(<ARGUMENT 1>, <ARGUMENT 2>....)
21+
22+
nested functions:
23+
24+
<FUNCTION 1>(<FUNCTION 2>(<ARGUEMNT 1>), <ARGUMENT 1>....)
25+
26+
series of functions:
27+
28+
<FUNCTION>(<ARGUMENT 1>, <ARGUMENT 2>...), <FUNCTION>()
29+
```
30+
31+
So statements or programs in RoyalScript consist purely of functions and their arguments.
32+
33+
##Types
34+
35+
###Literal
36+
37+
RoyalScript variables, function names, and struct names, or any name is represented as a literal. A literal is pure representation of data in UTF-8 format.
38+
39+
###Primtiive Types
40+
41+
RoyalScript has primitive types and custom or reference types created by structs
42+
43+
44+
45+
* Number
46+
* String
47+
* Boolean
48+
* List(Array)
49+
* null
50+
* function
51+
52+
Numbers represented both integers and floats, as JavaScript numbers do.
1053

0 commit comments

Comments
 (0)