!amEFGYrRomMpJtiMDK:matrix.org

Scala Metaprogramming

1838 Members
6 Servers

Load older messages


SenderMessageTime
28 Jul 2022
@_discord_734849617820254331:t2bot.iovelvetbaldmime#6377 it's based on the DOT calculus (Dependent Object Types), I think 13:34:51
@_discord_933857105868357663:t2bot.ioraz 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
@_discord_632729825647525922:t2bot.ioekrich#7695 I think it was all written from scratch and this avoids any namespace issues with the Scala 2 compiler? 14:29:22
@_discord_367347727279063050:t2bot.iosytherax#4974 joined the room.15:39:39
@_discord_367347727279063050:t2bot.iosytherax#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
@_discord_632729825647525922:t2bot.ioekrich#7695 An enum does that if you are using Scala 3. 15:43:09
@_discord_266680529020125185:t2bot.ioAdam ឵឵#4161 https://scastie.scala-lang.org/wWbz6uxsTAOTLMgCkogxow 15:44:37
@_discord_734849617820254331:t2bot.iovelvetbaldmime#6377 TIL about .values lol 😄 15:50:16
@_discord_734849617820254331:t2bot.iovelvetbaldmime#6377 damn it. 15:50:19
@_discord_367347727279063050:t2bot.iosytherax#4974 I find enums odd though as most of products are going to be custom 15:50:20
@_discord_734849617820254331:t2bot.iovelvetbaldmime#6377 wdym custom? 15:51:05
@_discord_367347727279063050:t2bot.iosytherax#4974 like Product isn't locked to just shoes and Pen, it can be defined by user 15:53:01
@_discord_266680529020125185:t2bot.ioAdam ឵឵#4161 A moment of silence for all the times you've manually enumerated the options 🙏 15:53:03
@_discord_367347727279063050:t2bot.iosytherax#4974 so there is builtins as well as custom 15:53:11
@_discord_734849617820254331:t2bot.iovelvetbaldmime#6377 just add case Other(custom: String) 😄 15:53:14
@_discord_734849617820254331:t2bot.iovelvetbaldmime#6377 Depends on usecase really 15:53:31
@_discord_266680529020125185:t2bot.ioAdam ឵឵#4161 String is is pretty non-finitely-enumerable though 15:53:58
@_discord_734849617820254331:t2bot.iovelvetbaldmime#6377 yep
that's why .values no longer compiles
clever girl :dinosaur:
15:54:16
@_discord_734849617820254331:t2bot.iovelvetbaldmime#6377 well, no dinosaur emojis. whatever. 15:54:23
@_discord_845013677816021083:t2bot.ioarmanbilge#6192 🦖 15:54:52
@_discord_266680529020125185:t2bot.ioAdam ឵឵#4161 The went all technical about it 🦕 15:54:55
@_discord_367347727279063050:t2bot.iosytherax#4974 what about this?
https://scastie.scala-lang.org/2x7IHcjtQem8ywAswYYfVg
15:54:59
@_discord_367347727279063050:t2bot.iosytherax#4974 I usually have like private construction and validation , this is just an example 😛 15:55:52
@_discord_367347727279063050:t2bot.iosytherax#4974 Product is usually a complex record with multiple fields 15:56:25
@_discord_632729825647525922:t2bot.ioekrich#7695 Lucky, not enough Java programming 🙂 15:57:02
@_discord_367347727279063050:t2bot.iosytherax#4974 doing it this way feels bit verbosy.. 15:57:15
@thisis271:matrix.orghhttseee joined the room.17:19:42
29 Jul 2022
@sis3020:matrix.orgsis3020 joined the room.03:12:44
@sis3020:matrix.orgsis3020Come try the top online game https://feetporn.win/ qmxnfn try today03:12:45
@sis3020:matrix.orgsis3020 left the room.09:19:20

There are no newer messages yet.


Back to Room ListRoom Version: 9