-
Notifications
You must be signed in to change notification settings - Fork 1
/
kaleDocs.txt
141 lines (105 loc) · 5.04 KB
/
kaleDocs.txt
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
| KALE | Documentation.txt
-----------------
The keyword 'munch' will be used to represent whatever the user must type
to invoke the munch interpreter.
-----------------
For help,
`munch -h`
-----------------
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Writing to Console:
****************************************************************************
write: your string goes here
string variables can be written directly into the string
no escape characters are necessary
****************************************************************************
Variables:
****************************************************************************
All variable declarations are proceeded by the keyword var:, then followed by
type -- int:, bool:, or str:. Then the variable name is declared. They are always
proceeded by an underscore.
Integers:
var: int: _variableName = 54
Booleans:
var: bool: _variableName = True
var: bool: _variableName2 = False
Capitalize the first letter of the boolean, i.e. True and False
Strings:
var: str: _variableName = String here
****************************************************************************
Conditions:
****************************************************************************
If statements:
follow the syntax
if: conditional_here -> operation_performed_if_true
Conditionals are space delineated; logical operators are 'and', 'or', 'not',
without the apostrophes.
if: 5 + 3 == 8 -> write: This evaluated to 'True'
if: (5 + 3 != 8) or True -> write: This also evaluated to 'True'
These are both examples of statements that will fully execute.
if: 5 + 3 != 8 -> write: This is False
The above statement, however, will not.
Variables may be written into both the condition and operation of a statement.
If statements may be nested; in other words, the operation_performed_if_true
may be another if statement.
****************************************************************************
User Input:
****************************************************************************
input is always stored in an explicitly declared variable; if the variable
has already been declared, redeclare it. The syntax is:
input: var: TYPE: variable_name = Prompt_Here:
Where TYPE: is either int: str: or bool:.
****************************************************************************
Math statements:
****************************************************************************
begin with keyword 'math: ' followed by variable syntax for an integer.
The variable should be equal to an equation --
math: var: int: _equation = 5 + 5
integer variables can be used in the statement.
operations include:
+ - * / ** (raises number to power i.e. 5 ** 2 = 25; 3 ** 3 = 27)
****************************************************************************
Loops:
****************************************************************************
for loops --
for: 10 ->
code block here
END:
for loops only accept integer arguments; they can be variables though.
while loops --
while: boolean evaluation ->
code block
END_LOOP:
while loops accept arguments that evaluate to either true or false
in the place marked 'boolean evaluation'.
****************************************************************************
clean
****************************************************************************
The munch interpreter creates temporary files to do things like run loops.
This works well, but if there is a keyboard interrupt while a loop is running,
you can end up having dotfiles stored in your working directory. While these
ought not impact performance, if you notice loops performing oddly, you can try
`munch -c`
which will clean up loose files that the interpreter is known to create.
***************************************************************************
---------------------------------------------------------------------------
SYSTEM MANAGEMENT
---------------------------------------------------------------------------
---------------------------------------------------------------------------
***************************************************************************
Refactoring files
***************************************************************************
To refactor words/variable names in files, munch accepts the flag -r.
`munch -r file_name old_phrase new_phrase`
The interpreter will make changes to the provided file, and store an exact
copy of the original file in file_name.backup in case you need to revert back.
***************************************************************************
Sending email
***************************************************************************
The munch tool can be used to send email from the command line. Use a terminal
editor (VIM, Nano...) to create a text file (or really any file) that contains
the body of the email. then pass
`munch -e body_file_name`
The program will prompt you for your email information and then send it.
***************************************************************************
Created by: Clayton McCray