From ad98266cae6f2bd89589cf1440328ca3ec94d35d Mon Sep 17 00:00:00 2001 From: Dmitry Matveyev Date: Sun, 24 Dec 2023 17:48:21 +0400 Subject: [PATCH] Add/remove spaces for code formatting (#523) Some of the formatting wasn't following the style guide. --- docs/expressions/object-literals.md | 8 ++++---- docs/generics/generics-and-reference-capabilities.md | 12 ++++++------ docs/testing/ponycheck.md | 2 +- docs/types/traits-and-interfaces.md | 4 ++-- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/expressions/object-literals.md b/docs/expressions/object-literals.md index 127856a9..1f74ac44 100644 --- a/docs/expressions/object-literals.md +++ b/docs/expressions/object-literals.md @@ -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)}) => @@ -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) }) ``` @@ -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 }) @@ -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) diff --git a/docs/generics/generics-and-reference-capabilities.md b/docs/generics/generics-and-reference-capabilities.md index 00aeb544..cac5fb5a 100644 --- a/docs/generics/generics-and-reference-capabilities.md +++ b/docs/generics/generics-and-reference-capabilities.md @@ -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) @@ -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) @@ -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) @@ -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) @@ -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) @@ -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()) diff --git a/docs/testing/ponycheck.md b/docs/testing/ponycheck.md index aca144c5..cfb3ed3c 100644 --- a/docs/testing/ponycheck.md +++ b/docs/testing/ponycheck.md @@ -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()) diff --git a/docs/types/traits-and-interfaces.md b/docs/types/traits-and-interfaces.md index 43e4b632..a71df3c8 100644 --- a/docs/types/traits-and-interfaces.md +++ b/docs/types/traits-and-interfaces.md @@ -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_. @@ -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.