Has my motd gone too far? It loads a random ANSI catgirl from a folder. I use arch btw, server runs minimized Ubuntu Server.

  • rtxn@lemmy.worldM
    link
    fedilink
    arrow-up
    5
    arrow-down
    1
    ·
    edit-2
    10 hours ago

    I’ve been learning Rust by going through The Book… there’s some wack-ass syntax in that language. I’ve mostly used C# and Python so most of it just looks weird… I can more or less understand what while let Some((_, top)) = iter.next() { ... } is doing, but .for_each(|((_, _, t), (_, _, b))| { ... } just looks like an abomination. And I mean the syntax in general, not this code in particular.

    • __dev@lemmy.world
      link
      fedilink
      arrow-up
      4
      ·
      9 hours ago

      but .for_each(|((_, , t), (, _, b))| { … } just looks like an abomination

      It’s not so different in python: for ((_, _, t), (_, _, b)) in zip(top, bottom):

      Or in C#: .ForEach(((_, _, t), (_, _, b)) => Console.Write(...));

        • Ignotum@lemmy.world
          link
          fedilink
          arrow-up
          1
          ·
          6 hours ago

          Yep, lambda or closure (it’s an anonymous function but it can also capture state from the enclosing function, i think pure lambdas can’t do that?)