Text Extractor TXR - News
Version 022 is out.
Item posted by Kaz Kylheku <kkylheku> on Tue 17 Nov 2009 09:39:20 PM UTC.
Fixed the output string stream crash, bug 28033.
There is a new kernel object type (identified by a 11 bit pattern in the tag). This represents C strings, and allows string literals to be first-class objects of string type, without consing any additional memory. If one is careful, this type can also be used to smuggle other C strings into functions, provided that these uses do not ``escape'' the context in which they are used. The C strings used this way have to be aligned to at least a four byte boundary: don't use with substrings!
First class literals mean that functions no longer have to use raw C strings in order to be used with literals. So for example format string in the format function now is ``obj_t '' and now ``wchar_t ''. You can pass a literal object, using the lit macro: lit("foo ~a") or you can pass a string object, and even a lazy string.
I've also eliminated C printf style formatting from the streams interface, and from all functions built on top of streams, like formatted exception throwing functions and such.
I've converted uses of raw C streams to using the object streams; e.g. where there was a call to fwprintf(stdout, ...), there is now a format(std_output, ...). The dependency on C streams is now minimal and confined to the streams module.
The next project task will be to eliminate the use of C99 wide streams, doing all UTF-8 encoding and decoding using the UTF8 module.
Powered by Savane 3.14-8aba.
Corresponding source code