-
Notifications
You must be signed in to change notification settings - Fork 0
/
SKATE-LANG-SPEC
55 lines (47 loc) · 1.25 KB
/
SKATE-LANG-SPEC
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
# SKATE LANG
P: NAME
Program: NAME
# Define the program name
# ========================
# The entrance of a whole program must use program name ENTRY
# A runable S-Lang program could consists multiple Programs
S: NAME
Space: NAME
# Define a namespace, using NAME:NAME to call
# You can connect it to mainspace use Connect:
# This connection can be simplified as:
SKATE: NAME
C: IDENTIFIER, BLOCKS
Connect: IDENTIFIER, BLOCKS
# You can connect all blocks into main space of a program by
# C: MAINSPACE->ANY PROGRAM->ALL
# In default, mainspace will be connected to S-LANG Skatetime (Runtime)
B: NAME
Blocks: NAME
# Blocks without names
B:
Blocks:
# End of a block
B!
Blocks!
# Construct a block in one line
B< SOMETHING >
V: NAME
Vars: NAME
# examples:
# V: foo
# V: foo bar
NAME << BLOCKS
# Copy one block into NAME
NAME = BLOCKS
# Assign a block into NAME
# So actually we can make a var with assignment
V: foo << BLOCKS
# V has memory management strategies, in default it will be [DYNAMIC][FUNCTION]
# Which means it's static, but it will be auto released as the function is ended
# Others are:
[FUNCTION] # FUNCTION wide
[GLOBAL] # global wide
[STATIC] # keeps the value until program stops
[DYNAMIC] # dispose the value ASAP
[USR] # memory managed by users