Lemmy Today
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
snaggen@programming.dev to Rust@programming.devEnglish ·
edit-2
2 years ago

The ???? operator

programming.dev

message-square
26
link
fedilink
188

The ???? operator

programming.dev

snaggen@programming.dev to Rust@programming.devEnglish ·
edit-2
2 years ago
message-square
26
link
fedilink

I found this funny.

The context is as explained by @laund@hachyderm.io

the issue is that you can’t return from inside a closure, since the closure might be called later/elsewhere

and this post was the asnwer to the question by @antonok@fosstodon.org

you got me curious what the record for the longest ? operator chain on crates.io is

Original post: https://fosstodon.org/users/antonok/statuses/111134824451525448

  • germanatlas@lemmy.blahaj.zone
    link
    fedilink
    English
    arrow-up
    12
    ·
    2 years ago

    I feel like a ???-operator would help many languages

    • zygo_histo_morpheus@programming.dev
      link
      fedilink
      arrow-up
      1
      ·
      2 years ago

      Scala has one, which throws a NotImplemented error

      • sugar_in_your_tea@sh.itjust.works
        link
        fedilink
        arrow-up
        1
        ·
        2 years ago

        Runtime or compile-time? If run-time, that sounds like a fun way to implement something like panic().

        • zygo_histo_morpheus@programming.dev
          link
          fedilink
          arrow-up
          1
          ·
          2 years ago

          runtime, the point is so that you can see if the types align and then come back and fill in the function bodies later

Rust@programming.dev

rust@programming.dev

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@programming.dev

Welcome to the Rust community! This is a place to discuss about the Rust programming language.

Wormhole

!performance@programming.dev

Credits
  • The icon is a modified version of the official rust logo (changing the colors to a gradient and black background)
Visibility: Public
globe

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

  • 37 users / day
  • 176 users / week
  • 393 users / month
  • 2.86K users / 6 months
  • 23 local subscribers
  • 6.92K subscribers
  • 959 Posts
  • 4.6K Comments
  • Modlog
  • mods:
  • snowe@programming.dev
  • Ategon@programming.dev
  • EdTheLegendary@programming.dev
  • kahnclusions@programming.dev
  • torcherist@programming.dev
  • BE: 0.19.11
  • Modlog
  • Legal
  • Instances
  • Docs
  • Code
  • join-lemmy.org