https://github.com/binkley/skratch
Kotlin Scratch Code
https://github.com/binkley/skratch
Last synced: 10 months ago
JSON representation
Kotlin Scratch Code
- Host: GitHub
- URL: https://github.com/binkley/skratch
- Owner: binkley
- License: other
- Created: 2017-02-10T16:38:32.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2024-05-02T23:17:24.000Z (over 1 year ago)
- Last Synced: 2025-03-20T10:56:14.351Z (10 months ago)
- Language: Kotlin
- Size: 1.13 MB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# Skratch
[](https://github.com/binkley/skratch/actions)
[](https://github.com/binkley/skratch/issues/)
[](https://github.com/binkley/skratch/pulls)
[](https://snyk.io/test/github/binkley/skratch)
[](http://unlicense.org/)
Kotlin Scratch Code
## Caveat emptor
This is an scratch, experimental repository. It might use force push.
## Modules
Drop use of JVM modules. Repeating the same thing 3 times is annoying:
- In the build dependencies
- In `module-info.java`
- In source code imports
## BDD
Two styles of BDD in Kotlin: strings and functions.
- Functions: passes BDD text
as [function names](./src/main/kotlin/hm/binkley/labs/skratch/bdd/funcs)
- Strings: passes BDD text
as [strings](./src/main/kotlin/hm/binkley/labs/skratch/bdd/strings)
## Matrix
Modelling the Pauli spin matrices.
## Money
Classic Ward Cunningham example.
### Rethink
Using subtypes for specific currencies is fraught with peril. See:
- https://deque.blog/2017/08/17/a-study-of-4-money-class-designs-featuring-martin-fowler-kent-beck-and-ward-cunningham-implementations/
- https://deque.blog/2017/08/22/a-follow-up-of-the-study-of-4-money-class-designs-why-not-having-currencies-as-type-parameters/
## Building
Gradle was tried out, and found lacking (and painful). Returned to dull yet
reliable Maven.
### Gotchas
* Remember to add the `--enable-preview` flag to the JVM, including when
running from inside an IDE
* Java heap space failures when tests fail
* `Rational` should extends `Complex` (with 0 imaginary portion), but
`Complex` uses rational values for its portions. How to untangle?