Skip to content

macros -> lambdas #279

@yakra

Description

@yakra

macros

Every macro you write makes you less 1337.

-Some random person on the internet.

While not 100% the case across the board, there's some truthiness to it.
Lambdas will work in many cases. Advantages include:

  • Safer
  • Smaller program size
  • Speed? Instruction cache?

Can't get rid of all of them, but here are some candidates:


other stuff

  • datacheck boilerplate
    A couple examples are above already, but in general, look for Datacheck::add.
  • sorting
    grep -n 'sort([^)]' \`find . -name \*.cpp`
    • Sorting regions.csv lines & eliminating the 1 use of sort_1st_csv_field reduces binary size 144 B.
    • sort_route_updates_oldest
    • What if a function is used multiple times, i.e. sort_root_at_label (5x)?
  • splitregion.cpp

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions