improved `~` macro