Trying to transform a tag structure, stuck on SeqFrag

26 views
Skip to first unread message

Hans-Christian Holm

unread,
Jul 9, 2015, 5:19:42 AM7/9/15
to scal...@googlegroups.com
I'm trying to transform a tree of TypedTags into another tree of TypedTags. Most of the time it works fine, but I'm unable to transform anything that comes in the shape of a SeqFrag. The SeqFrag contents is hidden in a private field xs. I could use reflection to read xs, but I'd rather not.

SeqFrags are created implicitly when a Seq of Frags needs to be a Frag. I could also use dummy span tags and vargargs expansion with _* for my Seqs, but I'm looking for a cleaner solution. Making SeqFrag.xs public could perhaps do the trick, or are there other ways to get the SegFrag contents?

Haoyi Li

unread,
Jul 26, 2015, 1:15:37 AM7/26/15
to Scalatags, jo...@hcholm.net, jo...@hcholm.net
I guess we could make it public, but in general I don't really think transforming the TypeTag tree is something that you should do. Perhaps you can talk a bit about what you're trying to do in the first place?

Also, if you really want to make the contents of SeqFrag public, just define your own SeqFrag and shadow the inbuilt one =)
Reply all
Reply to author
Forward
0 new messages