Friendica
Aria Desires
Aria Desires

Aria Desires

Gankra@toot.cat

Aria Desires

Gankra@toot.cat

It's me, the gay cat who maintains your docs

Author of The Rustonomicon and Learn Rust With Entirely Too Many Linked Lists. Also I made a lot of homestuck's games.

on a sabbatical

ActivityPub
2023-12-09 16:09:34 2023-12-09 16:09:33 2023-12-07 16:51:17 4218944

Aria Desires
Aria Desires
mastodon - Link to source

Aria Desires

2 years ago • •

Aria Desires

2 years ago • •


apparently this trick has fallen out of rust programmer folklore so PSA rust allows you to delay initialization of variables, and even Conditionally Initialize them

(it statically prevents you from messing up and will dynamically track whether they were initialized for cleanup)

this allows you to write things like this:

github.com/Gankra/socc-pair/bl…

screenshot of the linked code, which defines-but-doesn't-initialize "stdout" and "output_f" variables, then checks whether it should be writing to a file or stdout, initializes only one of them, and then sets another variable to a reference to whichever was initialized
#l403
  •  Languages
  •  Search Text
  •  Share via ...
⇧