You are here

Poll for a programming language.

4 posts / 0 new
Last post
dark_yux
Offline
Last seen: 8 years 7 months ago
Joined: 2007-10-23 11:23
Poll for a programming language.

Ok, I'm working on a programming language. Do think it appropriate to use an init method instead of a constructor?

Point pt = Point.__Init__(x, y);
! OR !
Point pt = Point[x, y];
! OR !
Point pt = Point(x, y);

I like the first one but I'm scared people won't like it. What do you think?

Aluísio A. S. G.
Offline
Last seen: 6 years 2 months ago
DeveloperTranslator
Joined: 2010-11-09 17:43
3rd

I'm used to the last form.
It would be good if you could add some kind of inference like in C++ (no need to name the constructor) or Vala (no need to declare the type).
By the way, how does the rest of the language looks like?

Previously known as kAlug.

dark_yux
Offline
Last seen: 8 years 7 months ago
Joined: 2007-10-23 11:23
Ok

I probably should change the language to the third one. However as far as type inference is concerned. I have decided that is is a statically typed language though it wouldn't hurt to do something like:

Point pt = (x, y); ! This looks the best.
Point pt = [x, y]; ! Blah, current implementation.
Point pt = __Init__(x, y); ! Original design I changed it to: Point.__Init__(x, y);

I changed it because the language has interfaces and inheritance and you may need to access the subclass, for example using the car and vehicle metaphor:

Vehicle car = __Init__(); ! How do you know the Implementation is a car? So I did...
Vehicle car = Car.__Init__();
! But I could always go crazy an allow this...
Vehicle car = __Car__(); ! How about putting the class names between underscores and just use the parenthesis for the parameters?

I'm trying to be a little different and not just do: Point pt = Point(x,y); The rest of the language is under wraps for the moment.

self.path = path if self.path == None else self.path

pawelmakles1
Offline
Last seen: 10 years 1 month ago
Joined: 2012-02-13 08:14
I Don't Understand A Bit

Pardon !!!I Can't Understand A Bit You Know!!! Pardon

PHP5, MySQL, Apache, Ruby, Batch, EXE, CRX (Chrome Extensions), AU3(AutoIT v3), JAVA, JAVAScript, INI, INF, Flash, Visual Basic, C, C++, Turbo C, C#, BASIC, Pascal.

Log in or register to post comments