全体として太一が感覚的に実践している事を論理的に説明しようと試みている為、
説明の粒度が適切でなかったり一貫性が無いように見える部分があるかもしれない。
普段やっているけども書ききれていない事も多分きっとある。
- コードを嗜む
- コードを学ぶ
- 武器を手に入れる
// Run with scala-cli httpserver.scala | |
// Save logback.xml file into ./resources dir | |
// Before generating native image binary, run first as above and make a real access to the URL | |
// so the native-image-agent can generate the metadata in ./resources dir. | |
// Then generate native image binary with: scala-cli package --native-image httpserver.scala | |
//> using scala "3.3.0" | |
//> using lib "dev.zio::zio:2.0.15" | |
//> using lib "dev.zio::zio-http:3.0.0-RC2" | |
//> using lib "dev.zio::zio-logging-slf4j2::2.1.13" | |
//> using lib "ch.qos.logback:logback-classic:1.4.8" |
class NumHolder { | |
int num = 0 | |
def plus(int n) { num += n; println 'puls!'; this } | |
def minus(int n) { num -= n; println 'minus!'; this } | |
def negative() { num = -num; println 'negative!'; this } | |
} | |
def nh = new NumHolder() | |
assert 0 == nh.num | |
nh += 1 |