FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

March 9th -- IO improvements, in, OS lib, lots of bugs fixed

 
Post new topic   Reply to topic     Forum Index -> MiniD
View previous topic :: View next topic  
Author Message
JarrettBillingsley



Joined: 20 Jun 2006
Posts: 457
Location: Pennsylvania!

PostPosted: Fri Mar 09, 2007 11:28 pm    Post subject: March 9th -- IO improvements, in, OS lib, lots of bugs fixed Reply with quote

I don't know how I'm getting so much done.

Added/Removed
  • Added readf() to the baselib.
  • New OS standard library. It has some timing facilities. There'll probably be more added to this.
  • Added 'in' and '!in' expressions for testing if a value is in a container. These can be overloaded with opIn.
  • Added array.range(), for creating quick lists of integers.
  • Put back the table library namespace with all the table functions, in order to call those functions on tables which have overridden them.
  • Added a much-needed (and epically long) page about metamethods to the language spec. Writing all the examples for this also helped me find a ton of bugs!


Changed
  • array.new() now takes an optional second parameter which is the value with which to fill the new array.
  • The IO library has been redone a bit. The File class has been replaced with a more general-purpose Stream class. File is now just a function which will return an instance of a Stream class. How you use File and what it returns shouldn't change from how you used them before. There are some new methods, though, including readf and seeking methods. There are now also stdin, stdout, and stderr as members of the IO library. They are just instances of the Stream class.
  • Added io.listDir().
  • Serialize and Deserialize now write out and read in wchar[] and dchar[] as UTF-8 strings. This saves a lot of space in compiled modules; they're now about 1/3 smaller on average. Of course this means that the format of compiled modules has again changed..
  • opCmp metamethods are now called.
  • Changed the metamethod names to be more like D (instead of opAddEq, opSubEq etc. it's opAddAssign, opSubAsssign etc.).
  • The compiler will no longer complain if you try to concatenate two constants of incompatible types, as this may be valid code (in the case of an opCat metamethod call).


Fixed
  • Fixed a bug with concatenation assignment, where errors weren't being detected.
  • There seems to be a bizarre bug regarding lazy parameters in D that was causing very niche cases to cause access violations when some array objects were collected (???). Something is messing with classinfo pointers. When I implement the "lazy" functions manually, the bug doesn't occur. I can't reproduce it though, and it only happens in very specific circumstances. Anyway this fixes some random bugs with indexing and slicing.
  • Fixed a compiler bug where index expressions couldn't be complex expressions (don't know HOW I missed that).
  • Fixed a compiler bug where constants in the left-hand sides of assignments weren't being folded.
  • Another folding bug where variable declarations with no initializers would crash the compiler.
  • There was actually a fairly major bug in the interpreter with indexing and slicing where the values that were being operated upon could become invalidated by a stack resize.. so that's fixed.
  • Fixed another compiler folding bug; class methods were not being folded.
  • Fixed concatenation in the interpreter.. again. This time it was catching errors when it shouldn't have, instead of the other way around.
  • Fixed an interpreter bug involving metamethods overwriting things they shouldn't overwrite. Actually a result of the stack index not getting set properly after a function call, but it didn't really manifest itself except in rare cases with metamethods.
  • Fixed reflexive operator metamethods. They were expecting a result from the metamethod and putting it back into the left-hand side, when these methods shouldn't return anything.
  • Bug in the compiler where some boolean constants weren't being encoded as booleans but as ints instead.


So there are now "in" expressions like in D (and also !in unlike in D). They return boolean values, though, so they're more for conditional testing.

Some of those bugs made me cringe. How on earth did they get in there..

Go check out the Wiki page on metamethods too! That was quite the project.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> MiniD All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group