You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
can be inefficient due to the iter -> Maybe<item> signature of the iterator. This leads to unnecessary creation of an intermediate Maybe object which can be quite expensive compared to a normal for loop. To fix this, some sort of AST transformation is necessary, but how should this be structured?
There could be some type of type directed rewrite rule here to optimize the AST in place.
let iter = y;
let continue-iter = true;
while continue-iter match &iter.next {
Some(x) => z;
None => continue-iter = false;
}
would be replaced with
let iter = y;
while non-zero(iter) match iter {
LCons(x,rest) => (z; iter = rest;);
}
for lists. This operation needs to be aware of AST patterns or understand them enough to do transformations. This is a specialization from iter to List<_> for the for macro, however it can't really be done during preprocessing and should also be generalized for code patterns that don't use a macro.
The text was updated successfully, but these errors were encountered:
This is the logical opposite of a macro
can be inefficient due to the
iter -> Maybe<item>
signature of the iterator. This leads to unnecessary creation of an intermediateMaybe
object which can be quite expensive compared to a normal for loop. To fix this, some sort of AST transformation is necessary, but how should this be structured?There could be some type of type directed rewrite rule here to optimize the AST in place.
would be replaced with
for lists. This operation needs to be aware of AST patterns or understand them enough to do transformations. This is a specialization from
iter
toList<_>
for thefor
macro, however it can't really be done during preprocessing and should also be generalized for code patterns that don't use a macro.The text was updated successfully, but these errors were encountered: