Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix doc typos #56

Merged
merged 1 commit into from May 5, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -49,7 +49,7 @@ In the [samples directory](samples/) you'll find some ports of [Flutter recipes]
Clone the ClojureDart repo.

```shell
git clone https://github.com/Tensegritics/ClojureDart.git`
git clone https://github.com/Tensegritics/ClojureDart.git
```

Go to the sample you want to try, let's say `fab`:
Expand Down
2 changes: 1 addition & 1 deletion doc/MUNGING.md
Expand Up @@ -43,7 +43,7 @@ In some contexts, suffixes may be appended to the munged name of a symbol. A suf

`$iproto` is for the class implementing the IProtocol for a given protocol.

`$cext` is for a a class implementing a class extension.
`$cext` is for a class implementing a class extension.

`$extension` is for the actual singleton of a `$cext`.

Expand Down
11 changes: 5 additions & 6 deletions doc/differences.md
Expand Up @@ -114,7 +114,7 @@ However when you want to access a static member **in Clojure** you would write `
### reify/deftype
#### `^:abstract`
**`deftype`**
A type name can have the `:abstract` metadata to indicate the generated class to be asbtract.
A type name can have the `:abstract` metadata to indicate the generated class to be abstract.

#### `:extends`
**`reify` and `deftype`**
Expand All @@ -132,8 +132,7 @@ The `:type-only` option instructs `deftype` to not create factory function (`->M

#### `^:mixin`
**`reify`, `defrecord` and `deftype`**
This metadata on implemented classes specify these classes should be considered [mixins](https://dart.dev/guides/language/language-tour#adding-features-to-a-class-mix
ins) and not [interfaces](https://dart.dev/guides/language/language-tour#implicit-interfaces).
This metadata on implemented classes specify these classes should be considered [mixins](https://dart.dev/guides/language/language-tour#adding-features-to-a-class-mixins) and not [interfaces](https://dart.dev/guides/language/language-tour#implicit-interfaces).

#### `^:getter`/`^:setter`
**`reify`, `defrecord` and `deftype`**
Expand All @@ -142,7 +141,7 @@ Method names can be tagged with `:getter` and/or `:setter` if the method is in f
For a getter you must provide a 1-arg arity of the method (`[this]`) and for a setter a 2-arg arity (`[this new-value]`).

#### Calling `super`
When you must call the `super` implementation (since one can now extends a super type) you have to add metadata on the "this" parameter of a method. For example when implementing a [State](https://api.flutter.dev/flutter/widgets/State/initState.html) one can write:
When you must call the `super` implementation (since one can now extend a super type) you have to add metadata on the "this" parameter of a method. For example when implementing a [State](https://api.flutter.dev/flutter/widgets/State/initState.html) one can write:

```clj
(initState [^{:super papa} self]
Expand All @@ -166,7 +165,7 @@ Dart methods may take named parameters, to call them in ClojureDart just use a k
```

### Generics
Unlike Java, Dart generics are not erased -- it means that on the JVM at runtime a `List<String>` is just a `List` but that in Dart at runtime it's still a `List<String>`. This creates two problems: expressing parametrized types and dealing with the mismatch between string typing of collections items and Clojure's collections.
Unlike Java, Dart generics are not erased it means that on the JVM at runtime a `List<String>` is just a `List` but that in Dart at runtime it's still a `List<String>`. This creates two problems: expressing parametrized types and dealing with the mismatch between strong typing of collections items and Clojure's collections.

#### Parametrized types

Expand All @@ -182,7 +181,7 @@ Two vectors containing the same items but with different type parameters are sti

When a `List` of a given type is expected the [`cast`](https://api.dart.dev/stable/2.9.3/dart-core/List/cast.html) method can be used to get a vector of the expected type. It's really a lightweight operation as only the root object is changed.

Furthermore, ClojureDart will automatically emits such `cast` calls. This means that in practice you can pass a Clojure vector (or a set or a map) where a typed List (resp. a Set or a Map) is expected and it will just work — as long as the items are of the right type, or at least those that will be looked up.
Furthermore, ClojureDart will automatically emit such `cast` calls. This means that in practice you can pass a Clojure vector (or a set or a map) where a typed List (resp. a Set or a Map) is expected and it will just work — as long as the items are of the right type, or at least those that will be looked up.


### Dart literals
Expand Down
2 changes: 1 addition & 1 deletion doc/flutter-helpers.md
Expand Up @@ -124,7 +124,7 @@ By default a resource is disposed by calling its `.dispose` method. However if t

The resource name is threaded (as per `->`) through the `:dispose` form. Most of the time it will be simply a method or a function.

Last, you can introduce intermediate values to use in resource initialization via `:let`:
Lastly, you can introduce intermediate values to use in resource initialization via `:let`:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not really a typo, I think both are valid, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I appreciate you taking a look!

I am not an expert, but I think 'lastly' sounds more natural here. Collins seems to agree:

Lastly has a much more common use. You use it to introduce a final point in a discussion, ask a final question, give a final instruction, or mention a final item in a list.

However, not very significant and perhaps not a typo as you stated, so please let me know if you want this bit reverted.


```clj
:with [res1 init1
Expand Down
2 changes: 1 addition & 1 deletion doc/quick-start.md
Expand Up @@ -74,7 +74,7 @@ Compiled Dart files are found under `lib/cljd-out`; to execute the program, just
dart run
```

By doing so you have ran your program on the Dart VM. To get an actual executable, enter:
By doing so you have run your program on the Dart VM. To get an actual executable, enter:

``` shell
dart compile exe -o helloworld bin/helloworld.dart
Expand Down