Page 1 of 1

Variable Types

Posted: Sun Jun 23, 2013 2:55 pm
by SirWobbyTheFirst
Hey guys, I was wondering if it might be possible to have things like variable types in LC? For example in C# you can define something as int for an integer and it will error out if you try and put a string in or leave the parameter empty.

Maybes you could have something like:

Code: Select all

Function MySuperAwesomeLazers Int pPew, Bool pIsBigPew, pLikesAnyKindaPew
   
End MySuperAwesomeLazers
Please don't judge me. I've never quite been firing on all cylinders.

Re: Variable Types

Posted: Sun Jun 23, 2013 4:52 pm
by mwieder
Yeah, I have a long-standing bug report on wanting this as an option. I'm holding off on doing anything like that until I see what the Open Language initiative gives us, because I think it might be doable without a lot of engine work.

Re: Variable Types

Posted: Sun Jun 23, 2013 7:09 pm
by SirWobbyTheFirst
Yeah, I was thinking along those lines too, should remember to note these kinds of things down with the original post. But alas, I'm stuck in a loop of derp at the moment. I personally think it would be great for those times when we need the flexibility of a variable that can store anything (Ala PHP) but also give us the ability to outright demand that an integer should be an integer.