JarrettBillingsley
Joined: 20 Jun 2006 Posts: 457 Location: Pennsylvania!
|
Posted: Thu Oct 19, 2006 11:00 pm Post subject: October 19th -- Stdlib goodness |
|
|
Today was some standard library. I put a bunch of functions in math (really easy), made a "char" library for character classification (which is set as the metatable for the character type, much like the string library is for strings), and added some goodies in the baselib -- namely, functions to check the type of something quicker than with "if(typeof(foo) == "string")", and assert.
I also began the ponderous task of making the compiler accept unicode input text. It looks at the BOM (if any) and determines the encoding, if not in a somewhat more strict manner than DMD does, and right now only ASCII encoding works. I'll have to do some research on unicode surrogates and such so that I can read in a single character and know if I need to read in more to build up a single dchar. It's easier than I expected but.. wouldn't you think that the unicode consortium would have had the foresight to implement some kind of standard BOM that would come at the beginning of every unicode-encoded file? Like if it were always 1 byte, and was just a code which was assigned to each encoding? Just seems dumb to have to write so many lines of code to determine the text encoding.
I'll also be trying to weed out any 'char's throughout the MiniD source and make it entirely dchar-based. Shouldn't take too incredibly long.
Also made accessing characters in string with index expressions part of the language, like I wanted. |
|