Data commit

This commit is contained in:
Ingy döt Net 2023-07-01 11:58:00 -04:00
parent 7387c8f97b
commit cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions

View file

@ -0,0 +1,17 @@
scala> def if2[A](x: => Boolean)(y: => Boolean)(xyt: => A) = new {
| def else1(xt: => A) = new {
| def else2(yt: => A) = new {
| def orElse(nt: => A) = {
| if(x) {
| if(y) xyt else xt
| } else if(y) {
| yt
| } else {
| nt
| }
| }
| }
| }
| }
if2: [A](x: => Boolean)(y: => Boolean)(xyt: => A)java.lang.Object{def else1(xt: => A): java.lang.Object{def else2(yt: =>
A): java.lang.Object{def orElse(nt: => A): A}}}

View file

@ -0,0 +1,21 @@
scala> if2(true)(true) {
| 1
| } else1 {
| 9
| } else2 {
| 11
| } orElse {
| 45
| }
res0: Int = 1
scala> if2(false)(true) {
| "Luffy"
| } else1 {
| "Nami"
| } else2 {
| "Sanji"
| } orElse {
| "Zoro"
| }
res1: java.lang.String = Sanji