Skip to content

Instantly share code, notes, and snippets.

@okram
Last active February 10, 2020 21:02
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 okram/4fc2e01d0c88a8f36fe61cbb0f33647a to your computer and use it in GitHub Desktop.
Save okram/4fc2e01d0c88a8f36fe61cbb0f33647a to your computer and use it in GitHub Desktop.
// a query
int[plus,1][mult,[plus,2]][is,[gt,5]]
// compiling the query for a single int value
int => int[plus,1][mult,[plus,2]][is,[gt,5]]
// int{?}<=int[plus,1][mult,int[plus,2]][is,bool<=int[gt,5]]
// compiling the query for 3 int values
int{3} => int[plus,1][mult,[plus,2]][is,[gt,5]]
// int{0,3}<=int{3}[plus,1][mult,int{3}[plus,2]][is,bool{3}<=int{3}[gt,5]]
// executing the query with 3 int values
int(1,2,3) => int{0,3}<=int{3}[plus,1][mult,int{3}[plus,2]][is,bool{3}<=int{3}[gt,5]]
// 1, 2, 3
// example flow with 1 as input
1 => [plus,1] => 2
2 => [plus,2]] => 4
2 => [mult, 4 => 8
8 => [gt,5]] => true
8 => [is, true => 8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment