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

August 17th - lines, lines, lines, LINES, LINES

 
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: Thu Aug 17, 2006 10:45 pm    Post subject: August 17th - lines, lines, lines, LINES, LINES Reply with quote

I spent an hour and a half putting in the line info generation into the compiler. It wasn't that difficult - just really, really tedious and repetitive. But it does seem to work nicely. Now the interpreter can issue more meaningful error messages (didn't get around to coding that yet though). I've also been thinking of implementing a "function name guess" as part of the debug info. Since functions aren't associated with a name, it can try to take a guess at what it's called, based on how it was defined. Would definitely make for some better error messages.

By the way, did I mention that I don't like how D allows for implicit conversion from enum to int/uint? I really hate it, in fact.

Lastly - this week has been really busy, and this weekend will be even busier, so there might not be much/any work done over the next couple of days, and what's worse - I might not have an internet connection for a couple of days after I move into my apartment.
Back to top
View user's profile Send private message
csauls



Joined: 27 Mar 2004
Posts: 278

PostPosted: Sat Aug 19, 2006 1:08 am    Post subject: Reply with quote

If the implicit enum promotion is a problem (I suppose for function specializations or such?) you could do something like this:

Code:

  enum _MyEnum_ : uint { Alpha, Beta, Gamma, Delta, Epsilon }

  typedef _MyEnum_ MyEnum ;

  void foo (uint x) { ... }

  void foo (MyEnum x) { ... }


Not elegant in the strictest sense, but effective.
_________________
Chris Nicholson-Sauls
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
JarrettBillingsley



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

PostPosted: Sat Aug 19, 2006 6:40 am    Post subject: Reply with quote

You're right, I was having trouble with function overloading. That's a good idea, thanks Smile
Back to top
View user's profile Send private message
hasan



Joined: 02 May 2005
Posts: 58

PostPosted: Sun Aug 20, 2006 3:14 am    Post subject: Reply with quote

csauls wrote:
If the implicit enum promotion is a problem (I suppose for function specializations or such?) you could do something like this:

Code:

  enum _MyEnum_ : uint { Alpha, Beta, Gamma, Delta, Epsilon }

  typedef _MyEnum_ MyEnum ;

  void foo (uint x) { ... }

  void foo (MyEnum x) { ... }


Not elegant in the strictest sense, but effective.

omg, this reminds me of the lovely (read: crappy) C style struct declaration:
Code:

typedef _myStruct { .... } myStruct;
Back to top
View user's profile Send private message
csauls



Joined: 27 Mar 2004
Posts: 278

PostPosted: Sun Aug 20, 2006 11:03 am    Post subject: Reply with quote

Sadly, that's basically what it is. *sigh*
_________________
Chris Nicholson-Sauls
Back to top
View user's profile Send private message AIM Address Yahoo Messenger
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