Skip to content

Commit a68291d

Browse files
committed
doc: Remove dash escaping references
1 parent bcca6cd commit a68291d

5 files changed

Lines changed: 15 additions & 15 deletions

File tree

doc/bindings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ File `file.ys`:
8282
name =: "World"
8383
other =: load("other.yaml")
8484

85-
foo:: -[(6 * 7), inc(41), 43.--, (3 .. 9):sum]
85+
foo:: +[(6 * 7), inc(41), 43.--, (3 .. 9):sum]
8686
bar:: other.stuff:shuffle.take(3)
8787
baz:: "Hello, $name!"
8888
```

doc/cheat.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The space before the `=` is required.
3838

3939
```
4040
hello =: 'Oh hello'
41-
a b c =: -[1 2 3] # Destructuring assignment
41+
a b c =: +[1 2 3] # Destructuring assignment
4242
```
4343

4444

@@ -50,14 +50,14 @@ then its not a valid YAML scalar.
5050
Also expressions that have stuff after a quoted string (`''` `""`) are not valid
5151
YAML.
5252

53-
You can turn text into a valid YAML plain scalar by prefixing it with a dash
54-
(`-`) or a plus (`+`).
55-
The dash or plus is removed when YS reads the scalar.
53+
You can turn text into a valid YAML plain scalar by prefixing it with a plus
54+
(`+`).
55+
The plus is removed when YS reads the scalar.
5656

5757
Note: the dash cannot have whitespace after it, but the plus can.
5858

5959
```
60-
-[1 2 3]: .map(inc) # => [2 3 4]
60+
+[1 2 3]: .map(inc) # => [2 3 4]
6161
=>: +
6262
'foo' + 'bar' # => 'foobar'
6363
```

doc/syntax.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ follow without them.
112112
```yaml
113113
!ys-0
114114
name =: 'world'
115-
say: -'Hello, ' + name + '!'
115+
say: +'Hello, ' + name + '!'
116116
```
117117

118118
Here we are doing something that you don't see in Clojure.
@@ -121,16 +121,16 @@ We're using `+` to concatenate strings.
121121
When YS operators are infix they compile to polymorphic functions that work on
122122
types of data other than numbers.
123123

124-
But what about the `-` in front of the string?
124+
But what about the `+` in front of the string?
125125

126-
Without the `-` this would be invalid YAML because YAML does not allow text on
126+
Without the `+` this would be invalid YAML because YAML does not allow text on
127127
the same line after a quoted string.
128128

129-
The `-` causes YAML to see everything after it as the scalar value:
129+
The `+` causes YAML to see everything after it as the scalar value:
130130
`-'Hello, ' + name + '!'`.
131131
This is like an escape character for situations where you want to write an
132132
expression but the first character is a syntax character in YAML.
133-
The `-` is removed and the rest of the scalar is compiled as an expression.
133+
The `+` is removed and the rest of the scalar is compiled as an expression.
134134

135135

136136
## Basic Function Definition
@@ -243,8 +243,8 @@ Clojure and YS have destructuring assignment support for both sequences
243243
and mappings.
244244

245245
```yaml
246-
-[a b c] =: foo()
247-
-{d :d e :e} =: bar()
246+
+[a b c] =: foo()
247+
+{d :d e :e} =: bar()
248248
```
249249

250250
This would assign the first three values of the sequence returned by `foo` to

doc/yes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ Note that this works for a `let` expression but not for a `def` expression:
218218
In YS it works fine:
219219

220220
```yaml
221-
-[a b] =: c()
221+
+[a b] =: c()
222222
```
223223

224224

util/version-bump

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,6 @@ defn main():
2727
text regx
2828
str/re-quote-replacement("$m1$vers$m2")
2929
say: "Bumped '$f'"
30-
warn: -['No Match!!' f regx]
30+
warn: +['No Match!!' f regx]
3131

3232
shell: 'make -C rust update'

0 commit comments

Comments
 (0)