BOLatexWriter

Tudor Girba tudor at tudorgirba.com
Sat Sep 24 23:01:29 MEST 2011


Hi,

I am testing Pier 2 some more, and now I got a problem in the Latex writer. Specifically, I do not quite understand the difference between the latex instance variable and the inherited stream one.

Take a look at the snippet below:

BOLatexWriter>>visitInternalLink: anInternalLink
		...
		latex tab ... square: [ stream nextPutAll: 'width='; print: ((anInternalLink parameterAt: 'width' ifAbsent: [ 100 ]) asNumber / 100.0); ... ]

When executed on a book we have two instance variables:
- stream: instance of GRPharoUtf8CodecStream (inherited)
- latex: instance of BOLatexStream which wraps stream

Now, it so happens that GRPharoUtf8CodecStream does not understand print:, but this method exists in BOLatexStream. I fixed the code by replacing stream with latex in the above method, and it works.

But, there are still other places that use stream, and I think they should all use the BOLatexStream instance instead. So, my question is: Is this intentional? Or maybe should we actually simply override the setting of stream and use that one for everything?

Cheers,
Doru



--
www.tudorgirba.com

"Yesterday is a fact.
 Tomorrow is a possibility.
 Today is a challenge."






More information about the smallwiki mailing list