#numeric #lookup #generate #function

macro numeric-lut

A library for generating numeric lookup functions

1 unstable release

0.1.0 Oct 19, 2019

#77 in #lookup

MIT license

9KB
195 lines

numeric-lut

A library for generating numeric lookup functions. Currently, it requires the use of the proc_macro_hygiene nightly feature.

Examples

#![feature(proc_macro_hygiene)]
let lut = numeric_lut::lut!(|x @ 0..8, y @ 0..16| -> u32 { x as u32 + y as u32 });
let x = lut(3, 10);
assert_eq!(13, x);

Dependencies

~1.5MB
~32K SLoC