tta.wtf
  • Communities
  • Create Post
  • Create Community
  • heart
    Support Lemmy
  • search
    Search
  • Login
  • Sign Up
PythOnRails@programming.dev to Programming@programming.dev · 2 years ago

"Useless syntax sugar": Numbered block parameters in Ruby

zverok.space

external-link
message-square
16
link
fedilink
  • cross-posted to:
  • technews@radiation.party
36
external-link

"Useless syntax sugar": Numbered block parameters in Ruby

zverok.space

PythOnRails@programming.dev to Programming@programming.dev · 2 years ago
message-square
16
link
fedilink
  • cross-posted to:
  • technews@radiation.party
"Useless syntax sugar": Numbered block parameters
zverok.space
external-link
Are they as ugly as I was told?
  • twelvefloatinghands@lemmy.world
    link
    fedilink
    arrow-up
    6
    arrow-down
    4
    ·
    2 years ago

    Damn, I wish rust had that

    • colonial@lemmy.world
      link
      fedilink
      arrow-up
      12
      arrow-down
      1
      ·
      2 years ago

      It wouldn’t be as relevant, since passing a function or method instead of a closure is much easier in Rust - you can just name it, while Ruby requires you to use the method method.

      So instead of .map(|res| res.unwrap()) you can do .map(Result::unwrap) and it’ll Just Work™.

      • jendrik@discuss.tchncs.de
        link
        fedilink
        arrow-up
        4
        ·
        2 years ago

        Except when Type::Method takes a reference, then it doesn’t just work

    • TheCee@programming.dev
      link
      fedilink
      arrow-up
      10
      ·
      2 years ago

      I’m glad it doesnt.

    • paperplane@lemmy.world
      link
      fedilink
      arrow-up
      3
      ·
      2 years ago

      Swift does, though using the dollar sign rather than underscores

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

      I sincerely doubt Rust would ever add something like this.

Programming@programming.dev

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

Welcome to the main community in programming.dev! Feel free to post anything relating to programming here!

Cross posting is strongly encouraged in the instance. If you feel your post or another person’s post makes sense in another community cross post into it.

Hope you enjoy the instance!

Rules

Rules

  • Follow the programming.dev instance rules
  • Keep content related to programming in some way
  • If you’re posting long videos try to add in some form of tldr for those who don’t want to watch videos

Wormhole

Follow the wormhole through a path of communities !webdev@programming.dev



Visibility: Public
globe

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

  • 280 users / day
  • 1.1K users / week
  • 3.7K users / month
  • 8.07K users / 6 months
  • 1 local subscriber
  • 24.5K subscribers
  • 1.5K Posts
  • 16.1K Comments
  • Modlog
  • mods:
  • snowe@programming.dev
  • Ategon@programming.dev
  • MaungaHikoi@lemmy.nz
  • UlrikHD@programming.dev
  • UI: unknown version
  • BE: 0.19.13
  • Modlog
  • Instances
  • Docs
  • Code
  • join-lemmy.org