sumtype 0.3.0
Paul Backus
snarwin at gmail.com
Mon May 7 13:31:52 UTC 2018
On Monday, 7 May 2018 at 09:23:04 UTC, Brian Schott wrote:
> I spent several hours trying to get this working with a
> non-trivial AST, and I think that it just isn't going to work
> until the compiler front-end gets better about handling
> recursive definitions. It fails in more-or-less the same way
> that my attempts at using std.variant did, and this is not the
> fault of your library.
>
> It's too bad, because the visitor pattern is not very good when
> you want to support visitors that should not accidentally
> modify the tree (i.e. arguments to `visit` are `const`), and
> other visitors whose job is to re-write the tree.
Thanks for taking a look!
There are definitely compiler issues that keep this (and
Algebraic) from being as useful as they could be (e.g., issue
1807 [1]), though so far, I've managed to find workarounds for
the ones I ran into. I'd be curious to see the code that was
giving you trouble, if you still have it.
[1]: https://issues.dlang.org/show_bug.cgi?id=1807
More information about the Digitalmars-d-announce
mailing list