Implements evaluation of the lambda function literal special form. This assigns a function to a specified set of rows. This supports a situation of returning different lambdas from different cases of a conditional. FunctionVectors enforce single assignment. A lambda cannot be for example a loop variable.
| 152 | // different cases of a conditional. FunctionVectors enforce single |
| 153 | // assignment. A lambda cannot be for example a loop variable. |
| 154 | void addFunction( |
| 155 | std::shared_ptr<Callable> callable, |
| 156 | const SelectivityVector& rows) { |
| 157 | for (auto& otherRows : rowSets_) { |
| 158 | auto begin = std::max(rows.begin(), otherRows.begin()); |
| 159 | auto end = std::min(rows.end(), otherRows.end()); |
| 160 | BOLT_CHECK( |
| 161 | !bits::hasIntersection( |
| 162 | otherRows.asRange().bits(), rows.asRange().bits(), begin, end), |
| 163 | "Functions in a FunctionVector may not have intersecting SelectivityVectors"); |
| 164 | } |
| 165 | |
| 166 | rowSets_.push_back(rows); |
| 167 | functions_.push_back(callable); |
| 168 | } |
| 169 | |
| 170 | bool containsNullAt(vector_size_t idx) const override { |
| 171 | return false; |