Skip to content

Commit b8b61e5

Browse files
Update ChatScript-Coding-Standards.md
1 parent 751cf19 commit b8b61e5

File tree

1 file changed

+31
-32
lines changed

1 file changed

+31
-32
lines changed

WIKI/ChatScript-Coding-Standards.md

Lines changed: 31 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,11 @@ Contents:
77

88
* [Indentation of rules](ChatScript-Coding-Standards.md#indentation-of-rules)
99
* [Rule Labels](ChatScript-Coding-Standards.md#rule-labels)
10-
* [Sample inputs](ChatScript-Coding-Standards.md#sample-inputs)
10+
* [Give Sample inputs](ChatScript-Coding-Standards.md#give-sample-inputs)
1111
* [Easy to read patterns](ChatScript-Coding-Standards.md#easy-to-read-patterns)
1212
* [Easy to read output](ChatScript-Coding-Standards.md#easy-to-read-output)
13-
* [Related rules bundles](ChatScript-Coding-Standards.md#related-rules-bundles)
14-
* [Localized Concepts and functions](ChatScript-Coding-Standards.md#localized-Ccncepts-and-functions)
13+
* [Bundle related rules](ChatScript-Coding-Standards.md#bundle-related-rules)
14+
* [Concept and Function localization](ChatScript-Coding-Standards.md#concept-and-function-localization)
1515
* [Keyword casing and Misspellings](ChatScript-Coding-Standards.md#keyword-casing-and-misspellings)
1616

1717
*Rationale*:<br>
@@ -78,6 +78,34 @@ have such a label, which will appear in an abstract.
7878
This allows others to refer to your rule and maybe find it in log files of customers.
7979

8080

81+
## Give sample inputs
82+
83+
* Give sample inputs for responders and rejoinders.
84+
* Give multiple samples for wildly different sentence constructions when you have multiple patterns in a rule.
85+
86+
Examples:
87+
```
88+
t: What year is it?
89+
#! 1993
90+
a: (~year) Great.
91+
92+
#! What is your name
93+
#! Who are you?
94+
?: ([
95+
(‘you [name called])
96+
(who be ‘you)
97+
])
98+
My name is Rose.
99+
```
100+
101+
*Rationale*:<br>
102+
Sample inputs explain your patterns. Instead of having to interpret the
103+
pattern, you know immediately what the rule is intending to do.
104+
105+
Sample inputs allow you to use `:abstract` to give non-programmers an overview of your code.
106+
Sample inputs also allow CS to unit-test your code for you using `:verify`.
107+
108+
81109
## Easy-to-read patterns
82110

83111
* Avoid superfluous parentheses.
@@ -108,34 +136,6 @@ When you are using multiple patterns in a rule, putting each
108136
on its own line allows you (or code reviewers) to comprehend each one separately.
109137

110138

111-
## Give sample inputs
112-
113-
* Give sample inputs for responders and rejoinders.
114-
* Give multiple samples for wildly different sentence constructions when you have multiple patterns in a rule.
115-
116-
Examples:
117-
```
118-
t: What year is it?
119-
#! 1993
120-
a: (~year) Great.
121-
122-
#! What is your name
123-
#! Who are you?
124-
?: ([
125-
(‘you [name called])
126-
(who be ‘you)
127-
])
128-
My name is Rose.
129-
```
130-
131-
*Rationale*:<br>
132-
Sample inputs explain your patterns. Instead of having to interpret the
133-
pattern, you know immediately what the rule is intending to do.
134-
135-
Sample inputs allow you to use `:abstract` to give non-programmers an overview of your code.
136-
Sample inputs also allow CS to unit-test your code for you using `:verify`.
137-
138-
139139
## Easy to read rule output
140140

141141
Indent each sentence and each CS code statement on separate lines.
@@ -171,7 +171,6 @@ On the other hand if the output is tiny, you might put it on a single line like
171171
u: (test) OK. $status += 1
172172

173173

174-
175174
## Bundle related rules
176175

177176
* Put related rules in topics

0 commit comments

Comments
 (0)