Saturday, August 18, 2007

More on the hybrid type system

See my previous post about how I want both denotional and structural typing.

I had decided to take a year off from implementation to avoid burnout. That was on Father's day which was not too long ago. However I might be looking for a job soon so I want to review my code so that I can present it to potential employees. So while I'm at it I might as well rip out the old class system and throw in the new typedef system. That of course got me thinking, if I can typedef class literals to make named classes, shouldn't I also be able to typedef other type expressions? For example shouldn't I be able to typedef pointer types?

typedef A@ AP //AP is a named type with the structure A@

ok so now I can use it as an argument to or return value from a function:

(AP arg)->(AP ret) f { ret=arg }

However how to I get at the pointer value? It isn't named. I could add a "this" keyword, so ap.this would return an A@ but that seems to be the first step down the path to special case land.

Perhaps for now typedef will be limited to class types. Thoughts?

No comments: