Right, it would have to be @mut Expr to allow for cycles... and you'd have
to really work hard to construct the cycle. At any rate, this isn't what
you'd want - very probably just using ~Expr would be enough.


On Mon, Oct 28, 2013 at 8:29 PM, Daniel Micay <[email protected]> wrote:

> On Mon, Oct 28, 2013 at 2:27 PM, Oren Ben-Kiki <[email protected]> wrote:
>
>> If you use ~Expr instead of @Expr, then the expressions would have to
>> form a tree (A = B + C). If you use Rc<Expr>, you could build a DAG (A = B
>> + B). With @Expr (if that worked), in principle you could allow for cycles
>> (A = B + A), which is probably not what you want.
>>
>
> You won't actually be able to create cycles with @T unless T is non-Freeze
> because it's immutable and Rust doesn't use laziness.
>
_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to