Lemmy Coupou.fr
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
lemtoman@lemmy.ml to Rust Programming@lemmy.ml · 4 years ago

Are there other languages that rust where enums can store data?

message-square
message-square
6
link
fedilink
7
message-square

Are there other languages that rust where enums can store data?

lemtoman@lemmy.ml to Rust Programming@lemmy.ml · 4 years ago
message-square
6
link
fedilink
  • northbound_goat@szmer.info
    link
    fedilink
    arrow-up
    8
    ·
    4 years ago

    Most functional languages, like Haskell, ML family (SML, OCaml, F#). They’re usually not using an enum keyword though.

    • Ephera@lemmy.ml
      link
      fedilink
      arrow-up
      7
      ·
      4 years ago

      Yeah, in language theory, this kind of thing is called an “Algebraic Data Type”: https://en.wikipedia.org/wiki/Algebraic_data_type

Rust Programming@lemmy.ml

rust@lemmy.ml

Subscribe from Remote Instance

Create a post
You are not logged in. However you can subscribe from another Fediverse account, for example Lemmy or Mastodon. To do this, paste the following into the search field of your instance: !rust@lemmy.ml
Visibility: Public
globe

This community can be federated to other instances and be posted/commented in by their users.

  • 10 users / day
  • 31 users / week
  • 100 users / month
  • 294 users / 6 months
  • 1 local subscriber
  • 9.39K subscribers
  • 569 Posts
  • 1.46K Comments
  • Modlog
  • mods:
  • Nutomic@lemmy.ml
  • Joe@lemmy.ml
  • AgreeableLandscape@lemmy.mldeleted by creator
  • BE: 0.19.20
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org