Variable Types

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, LCMark

Locked
SirWobbyTheFirst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 239
Joined: Tue Jun 30, 2009 11:15 pm

Variable Types

Post by SirWobbyTheFirst » Sun Jun 23, 2013 2:55 pm

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.

mwieder
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3581
Joined: Mon Jan 22, 2007 7:36 am
Location: Berkeley, CA, US
Contact:

Re: Variable Types

Post by mwieder » Sun Jun 23, 2013 4:52 pm

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.

SirWobbyTheFirst
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 239
Joined: Tue Jun 30, 2009 11:15 pm

Re: Variable Types

Post by SirWobbyTheFirst » Sun Jun 23, 2013 7:09 pm

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.

Locked

Return to “Engine Contributors”