Crates.io | funkjon |
lib.rs | funkjon |
version | 1.0.2 |
source | src |
created_at | 2024-01-19 19:45:54.53869 |
updated_at | 2024-04-12 22:05:35.224708 |
description | One of the worst macros this world has ever been (dis)graced with. |
homepage | https://github.com/david-d-h/funkjon |
repository | https://github.com/david-d-h-/funkjon |
max_upload_size | |
id | 1105672 |
size | 5,211 |
With funkjon, you too can create your very own function.
funkjon!(greet :: name {
println!("Hello, {name}.");
} as (String) -> Unit);
greet("David".to_string());
By the way, Unit
is the return type. It is equivalent to ()
.
You can change it by just putting something other than Unit
next to the right arrow (->
).
funkjon!(greet ::<T: std::fmt::Display>:: name {
println!("Hello, {name}.");
} as (T) -> Unit);
greet("David");
Or with a where clause
funkjon!(greet ::<T>:: name {
println!("Hello, {name}.");
} as (T) -> Unit
where T: std::fmt::Display,
);
greet("David");