Advertisement

Template keyword

Started by July 18, 2003 05:56 PM
1 comment, last by Jonbca 21 years, 4 months ago
Well, I've been working on a programming language for quite a while now. Just to give you some of it's backgroun/specs, it's built on top of Java (no coments please :-) ), is object oriented, has a high and low level counterparts(c++ and assm type setup). Due to my experience in Java, I want to add templates to the language in a completly transparrent manor. THis is coming along very well with the way that i've setup the storage and linkage of classes and their methods, but one thing I want to do is make it look like this: int number = GetTimeInMilli(); String time = GetTimeInMilli(); print(number) // 1234 print(time) // "1234" or even instead of: template < class T > T var; just have: T var where T will be a built in polymorphic keyword. This makes it so a method can have several different return types, something like: T get(){ if(isAnInt) return int1; if(isAnFloat) return float; } The question I have is, what should this keyword be. I dont want it to be template, as it is an unclear keyword IMHO, i was thinking abstract, but that doesn't work as it is a class modifier. The other option is to have all types be a subclass of Object, like in Java, but this incures quite a bit of overhead. The system I have setup for this works very well, so that isn't too much of a problem, I just was hoping for some input on this syntax. Just a though, I write too much :-) [edited by - jonbca on July 18, 2003 6:57:43 PM]
how about "variant"
or "foo"
or "whatever"
or "variable"
or "ctb" (compile time bound)
or "wtf"
or "placeholder"
or "que?"
or "snarf"
or "tony" ?

I especially like that last one...

Tony

Advertisement
< sarcasm > As much as I LOVE the sound of tony number, or any other usage of that keyword < /sarcasm > i really really like the sound of the keyword variant. thanks for the time. This isn't etched into stone, so if anyone else has any suggestions, shoot away.

[edited by - jonbca on July 19, 2003 1:10:42 PM]

This topic is closed to new replies.

Advertisement