I'm trying to create a function which will output a list of numbers based on an expression given to it.
Does anyone know how I can pass an expression through a function and have it evaluated within the function?
This is what I have so far:
@function patt($expression, $b: 10) {
$result: ();
@for $i from 1 through 10 {
$result: append($result, unquote($expression));
}
@return $result;
}
Example usage:
$list: patt('$i * $b + 2');
Unfortunately this doesn't work. Presumably the expression is being treated as a string within the function.