Page 1 of 1

type (SOLVED)

Posted: Tue Sep 20, 2016 9:30 am
by MaxV
How works type?
May you show me some examples?
What does "A type definition defines an alias, it names the given type with the given Name, allowing the name to be used instead of the type." means? Is it dangerous?

Re: type

Posted: Tue Sep 20, 2016 9:38 am
by bn
Hi Max,

Code: Select all

on mouseUp
   select after field 1
   type "abcd"
end mouseUp
Kind regards
Bernd

Re: type alias definitions

Posted: Tue Sep 20, 2016 10:09 am
by peter-b
Bernd: MaxV is referring to type definitions in LiveCode Builder, not the "type" command in LiveCode Script.

MaxV: For example:

Code: Select all

public type URI is String

public handler GetHomeURI() returns URI
   return "https://livecode.com/"
end handler
It's not currently mega useful to use type definitions in LCB, because you can only alias existing types and there's no way to create new, distinct types. Good news is that this will very likely be changing as part of the Infinite LiveCode project.

Re: type

Posted: Tue Sep 20, 2016 10:16 am
by bn
Ah, it would help to read what sub forum has been posted to, sorry for the noise

Kind regards
Bernd

Re: type

Posted: Tue Sep 20, 2016 10:32 am
by dave.kilroy
Max are you by any chance asking how to extract meaning from a particularly mushy sentence in the "LiveCode Builder Language Reference" section in the Guide (now part of the dictionary)?
A type definition defines an alias, it names the given type with the given Name, allowing the name to be used instead of the type.
So to answer your question - I don't know - the meaning is elusive and slippery like a wet fish. I think if we were to read the whole document we would have a better idea (English as a language is mushy). Actually I did read that document about six months ago and think I did have a slight grasp on it's meaning at the time - but on examining it now it's swum away...

OK here's my best attempt - a little later in the document there is "a type describes a kind of value" so my current reading of Max's sentence is "A type definition creates an alias (an alias being a type and name pairing) which means if you want, for example, to refer to the type of a variable you declared as an 'Integer', you can use the alias 'Integer'"

Now my head hurts. Who can do a better interpretation? Or correct what I've written?

Kind regards

Dave

Re: type (SOLVED)

Posted: Tue Sep 20, 2016 11:03 am
by MaxV
Thank you. :D

Re: type alias definitions

Posted: Sun Sep 25, 2016 4:06 pm
by seaniepie
peter-b wrote:... Good news is that this will very likely be changing as part of the Infinite LiveCode project.
So Infinite is still happening then!? This is the first I've heard of it since May at the funding. 3 Months and a Summer 2016 delivery was promised, "not 2017"! I'm surprised that no-one has taken the time to update us on its progress and apologise for the delay. I shouldn't be surprised as it's not really the LC way, to come through on promises or make apologies. Where is our $65k?

Sorry to MaxV for the subject hijacking.

Re: type (SOLVED)

Posted: Tue Sep 27, 2016 8:35 pm
by PaulDaMacMan
^ I posted a similar complaining about Infinite LiveCode not being seen anywhere on the first day of autumn on the FaceBook LC dev group, but I didn't really expect it to happen by then, I am just super-jazzed and chomping at the bit to get into it. If you look at the github LC site you will see there are some things going on, like Java-FFI for example. I was expecting it for 8.1/8.2 release but it looks like it will be LiveCode 9 now.

Re: type (SOLVED)

Posted: Wed Sep 28, 2016 9:15 pm
by seaniepie
Java will definitely be useful and good to have. But I was more hoping for Obj-C myself. So far I have had no response to my posts on the blog site or here on the forum. I have just sent an email via Heather and hopefully we'll hear something back soon. Or maybe even a pledge refund. Though I doubt very much the later. And marginally less the former :cry:

Re: type (SOLVED)

Posted: Wed Sep 28, 2016 10:04 pm
by FourthWorld
Sean, forgive my ignorance of Objective-C, but what makes accessing libraries made with it prohibitively difficult from C++?

Re: type (SOLVED)

Posted: Wed Sep 28, 2016 10:20 pm
by peter-b
seaniepie wrote:Java will definitely be useful and good to have. But I was more hoping for Obj-C myself. So far I have had no response to my posts on the blog site or here on the forum. I have just sent an email via Heather and hopefully we'll hear something back soon. Or maybe even a pledge refund. Though I doubt very much the later. And marginally less the former :cry:
Objective C stuff will be phase 2, and generic C FFI bindings will be phase 3. We are doing Infinite LiveCode in stages so that we keep the scope of each part of the project manageable and well-defined.