I am trying a query list comprehension:
> (set xs '(1 2 3 4 5 6 7 8))
> (lc ((<- x xs) (when (> x 5))) x)
But I am getting the error exception error: undefined function when/1.
Is it possible to apply guard statements to lc?
I am trying a query list comprehension:
> (set xs '(1 2 3 4 5 6 7 8))
> (lc ((<- x xs) (when (> x 5))) x)
But I am getting the error exception error: undefined function when/1.
Is it possible to apply guard statements to lc?
Copyright © 2021 Jogjafile Inc.
According to the LFE User Guide, within a list comprehension qualifier, the guard must precede the list expression:
This means your example should be written as follows:
You could alternatively treat the greater-than expression as a normal boolean expression qualifier: