Skip to content

Commit

Permalink
Add/remove spaces for code formatting (#523)
Browse files Browse the repository at this point in the history
Some of the formatting wasn't following the style guide.
  • Loading branch information
greenfork committed Dec 24, 2023
1 parent 23ec447 commit ad98266
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
8 changes: 4 additions & 4 deletions docs/expressions/object-literals.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Lambdas can be used to capture from the lexical scope in the same way as object

```pony
class Foo
new create(env:Env) =>
new create(env: Env) =>
foo({(s: String)(env) => env.out.print(s) })
fun foo(f: {(String)}) =>
Expand All @@ -110,7 +110,7 @@ class Foo
It's also possible to use a _capture list_ to create new names for things. A capture list is a second parenthesised list after the parameters:

```pony
new create(env:Env) =>
new create(env: Env) =>
foo({(s: String)(myenv = env) => myenv.out.print(s) })
```

Expand All @@ -122,7 +122,7 @@ If the lambda object is not declared with a specific reference capability, the r
use "collections"
actor Main
new create(env:Env) =>
new create(env: Env) =>
let l = List[U32]
l.>push(10).>push(20).>push(30).push(40)
let r = reduce(l, 0, {(a:U32, b:U32): U32 => a + b })
Expand All @@ -145,7 +145,7 @@ As mentioned previously the lambda desugars to an object literal with an `apply`
use "collections"
actor Main
new create(env:Env) =>
new create(env: Env) =>
let l = List[String]
l.>push("hello").push("world")
var count = U32(0)
Expand Down
12 changes: 6 additions & 6 deletions docs/generics/generics-and-reference-capabilities.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ class Foo[A]
fun ref set(c: A) => _c = c
actor Main
new create(env:Env) =>
new create(env: Env) =>
let a = Foo[U32](42)
env.out.print(a.get().string())
a.set(21)
Expand All @@ -55,7 +55,7 @@ class Foo
fun ref set(c: String ref) => _c = c
actor Main
new create(env:Env) =>
new create(env: Env) =>
let a = Foo(recover ref String end)
env.out.print(a.get().string())
a.set(recover ref String end)
Expand All @@ -79,7 +79,7 @@ class Foo
fun ref set(c: String ref) => _c = c
actor Main
new create(env:Env) =>
new create(env: Env) =>
let a = Foo(recover ref String end)
env.out.print(a.get().string())
a.set(recover ref String end)
Expand All @@ -103,7 +103,7 @@ class Foo
fun ref set(c: String iso) => _c = c
actor Main
new create(env:Env) =>
new create(env: Env) =>
let a = Foo(recover iso String end)
env.out.print(a.get().string())
a.set(recover iso String end)
Expand Down Expand Up @@ -156,7 +156,7 @@ class Foo
fun ref set(c: String iso) => _c = consume c
actor Main
new create(env:Env) =>
new create(env: Env) =>
let a = Foo(recover iso String end)
env.out.print(a.get().string())
a.set(recover iso String end)
Expand All @@ -179,7 +179,7 @@ class Foo[A]
fun ref set(c: A) => _c = consume c
actor Main
new create(env:Env) =>
new create(env: Env) =>
let a = Foo[String iso]("Hello".clone())
env.out.print(a.get().string())
Expand Down
2 changes: 1 addition & 1 deletion docs/testing/ponycheck.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class _ListReverseOneProperty is Property1[Array[USize]]
fun name(): String => "list/reverse/one"
fun gen(): Generator[Array[USize]] =>
Generators.seq_of[USize, Array[USize]](Generators.usize() where min=1,max=1)
Generators.seq_of[USize, Array[USize]](Generators.usize() where min = 1, max = 1)
fun property(arg1: Array[USize], ph: PropertyHelper) =>
ph.assert_array_eq[USize](arg1, arg1.reverse())
Expand Down
4 changes: 2 additions & 2 deletions docs/types/traits-and-interfaces.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ trait Named
trait Bald
fun hair(): Bool => false
class Bob is (Named & Bald)
class Bob is (Named & Bald)
```

It is possible for a class to have relationships with multiple categories. In the above example, the class `Bob` _provides both Named and Bald_.
Expand All @@ -84,7 +84,7 @@ trait Named
trait Bald is Named
fun hair(): Bool => false
class Bob is Bald
class Bob is Bald
```

It is also possible to combine categories together. In the example above, all `Bald` classes are automatically `Named`. Consequently, the `Bob` class has access to both hair() and name() default implementation of their respective trait. One can think of the `Bald` category to be more specific than the `Named` one.
Expand Down

0 comments on commit ad98266

Please sign in to comment.