Jump to content
  • Advertisement
  • entries
  • comments
  • views

Method Groups in Tangent.

Sign in to follow this  


(true(),false()) select bool() == Ambiguous - True:True
(true(),false()) select false() == false() - True:True
(true(),false()) select true() == true() - True:True
(true(),false()) select null() == Undefinded - True:True
(true(),void(true)) select true() == true() - True:True
(true(),void(true)) select void(null) == void(true) - True:True

My little toy language is coming along. Tonight's work? Starting in on method groups. The few little unit tests from above are checking on the function that does type picking/resolution (rather than the actual dispatch). As you might be able to see, it will be smart enough to pick the right one based on return type if the requested return type sufficiently limits the options.

For now at least. I suspect that I might run into troubles/conflicts when actually getting the dispatch going. Once this gets done I should be able to start importing basic/test .NET types. Once that is done, I can start on the really dubious stuff (making the syntax analysis smart enough to allow user defined operators).

An interesting side effect of how I did things allows this sort of thing to work:

delegate int foo(int x, int y);
foo IntOperator = delegate(){return(42);};

You'll still need to call IntOperator with 2 ints, but the assignment will work and you'll always get 42 back. I'm not sure if this has some advantage or if it'll prevent useful error reporting later on. Kinda weird, but for now it's in.
Sign in to follow this  


Recommended Comments

There are no comments to display.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!