Skip to content

Instantly share code, notes, and snippets.

@vendethiel
Forked from disnet/gist:4165526
Created January 3, 2014 00:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vendethiel/8230494 to your computer and use it in GitHub Desktop.
Save vendethiel/8230494 to your computer and use it in GitHub Desktop.
macro null_helper {
rule {($processed ...) ($rest)} => {
$processed (.) ... . $rest
}
rule {($processed ...) ($rest_head $rest ...)} => {
$processed (.) ... . $rest_head
&& null_helper ($processed ... $rest_head) ($rest ...)
}
}
macro nullity {
rule {($x)} => {
$x
}
rule {($head . $rest (.) ...)} => {
$head && null_helper ($head) ($rest ...)
}
}
nullity (x.y.z)
// x && x.y && x.y.z
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment