REBOL has no built-in way to check lists. However, REBOL has a powerful tool (known as parse ) that can be used to create domain languages (DSLs). I used parse to create such a mini DSL for list comprehension. To interpret the expression, a block containing understanding is passed to a function, which, due to the lack of a better term, which I called comprehend .
Example:
comprehend [(a * b) for a in 1x100 for b in 4x10 where (all [odd? a odd? b])]
For some reason, comprehend is not suitable for me, but something like eval is too general.
I have not found another language that requires a keyword or function to understand lists. They are pure syntactic sugar, wherever they exist. Unfortunately, I do not have such an option. So, seeing that I should have a function, what is a good, short, logical name for it?
list-comprehension naming dialect rebol
Gregory higherley
source share