Mercurial > lbo > hg > lazycall
view README.md @ 4:55bf86f40457 default tip
Fix README
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Fri, 20 Nov 2020 23:33:22 +0100 |
parents | 86c31f04fd15 |
children |
line wrap: on
line source
# `lazycall` is very useless. It allows for automatically moving the computation of arguments into a called function. ```rust #[lazy] fn myfunc(a: i32) -> i32 { a + 1 } fn main() { println!("{}", lazycall!(myfunc(some_expensive_func()))); // essentially: println!("{}", myfunc_lazy(|| some_expensive_func())); // wherein myfunc_lazy() evaluates the specified closure. } ``` It is mostly to be viewed as a finger exercise in procedural macros.