28 Jul 2022 |
velvetbaldmime#6377 | it's based on the DOT calculus (Dependent Object Types), I think | 13:34:51 |
raz | still the sbt dependency is "org.scala-lang" %% "scala3-compiler" % "3.1.3" , then you are doing import dotty.tools.dotc.Compiler | 13:52:07 |
ekrich#7695 | I think it was all written from scratch and this avoids any namespace issues with the Scala 2 compiler? | 14:29:22 |
| sytherax#4974 joined the room. | 15:39:39 |
sytherax#4974 | is there a way where I can define constant i.e
object Product:
val Shoes = Product("👠")
val Pen = Product("🖊")
val all: List[Product] == Automatically enumerate all products? | 15:39:39 |
ekrich#7695 | An enum does that if you are using Scala 3. | 15:43:09 |
Adam ឵឵#4161 | https://scastie.scala-lang.org/wWbz6uxsTAOTLMgCkogxow | 15:44:37 |
velvetbaldmime#6377 | TIL about .values lol 😄 | 15:50:16 |
velvetbaldmime#6377 | damn it. | 15:50:19 |
sytherax#4974 | I find enums odd though as most of products are going to be custom | 15:50:20 |
velvetbaldmime#6377 | wdym custom? | 15:51:05 |
sytherax#4974 | like Product isn't locked to just shoes and Pen, it can be defined by user | 15:53:01 |
Adam ឵឵#4161 | A moment of silence for all the times you've manually enumerated the options 🙏 | 15:53:03 |
sytherax#4974 | so there is builtins as well as custom | 15:53:11 |
velvetbaldmime#6377 | just add case Other(custom: String) 😄 | 15:53:14 |
velvetbaldmime#6377 | Depends on usecase really | 15:53:31 |
Adam ឵឵#4161 | String is is pretty non-finitely-enumerable though | 15:53:58 |
velvetbaldmime#6377 | yep that's why .values no longer compiles clever girl :dinosaur: | 15:54:16 |
velvetbaldmime#6377 | well, no dinosaur emojis. whatever. | 15:54:23 |
armanbilge#6192 | 🦖 | 15:54:52 |
Adam ឵឵#4161 | The went all technical about it 🦕 | 15:54:55 |
sytherax#4974 | what about this? https://scastie.scala-lang.org/2x7IHcjtQem8ywAswYYfVg | 15:54:59 |
sytherax#4974 | I usually have like private construction and validation , this is just an example 😛 | 15:55:52 |
sytherax#4974 | Product is usually a complex record with multiple fields | 15:56:25 |
ekrich#7695 | Lucky, not enough Java programming 🙂 | 15:57:02 |
sytherax#4974 | doing it this way feels bit verbosy.. | 15:57:15 |
| hhttseee joined the room. | 17:19:42 |
29 Jul 2022 |
| sis3020 joined the room. | 03:12:44 |
sis3020 | Come try the top online game https://feetporn.win/ qmxnfn try today | 03:12:45 |
| sis3020 left the room. | 09:19:20 |