So we parse a text file into a list of Block objects. This means client code does things like this:
blocks.filter( _.isInstanceOf[ CodeBlock ] )
To get all code blocks. This kind of, well, sucks. Something is wrong here, because it sure seems like my type hierarchy is wrong if we have to cast to do anything useful.
So we parse a text file into a list of
Block
objects. This means client code does things like this:To get all code blocks. This kind of, well, sucks. Something is wrong here, because it sure seems like my type hierarchy is wrong if we have to cast to do anything useful.