type (SOLVED)

Moderators: LCMark, LCfraser

Post Reply
MaxV
Posts: 1309
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

type (SOLVED)

Post by MaxV » Tue Sep 20, 2016 9:30 am

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?
Last edited by MaxV on Tue Sep 20, 2016 11:02 am, edited 1 time in total.
Livecode Wiki: http://livecode.wikia.com
My blog: http://livecodeitalia.blogspot.it
To post code use this: http://tinyurl.com/ogp6d5w

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3184
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: type

Post by bn » Tue Sep 20, 2016 9:38 am

Hi Max,

Code: Select all

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

peter-b
Posts: 182
Joined: Thu Nov 20, 2014 2:14 pm
Location: LiveCode Ltd.

Re: type alias definitions

Post by peter-b » Tue Sep 20, 2016 10:09 am

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.
LiveCode Open Source Team — @PeterTBBrett — peter.brett@livecode.com

bn
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 3184
Joined: Sun Jan 07, 2007 9:12 pm
Location: Bochum, Germany

Re: type

Post by bn » Tue Sep 20, 2016 10:16 am

Ah, it would help to read what sub forum has been posted to, sorry for the noise

Kind regards
Bernd

dave.kilroy
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 828
Joined: Wed Jun 24, 2009 1:17 pm
Location: Plymouth, UK
Contact:

Re: type

Post by dave.kilroy » Tue Sep 20, 2016 10:32 am

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
"...this is not the code you are looking for..."

MaxV
Posts: 1309
Joined: Tue May 28, 2013 2:20 pm
Location: Italy
Contact:

Re: type (SOLVED)

Post by MaxV » Tue Sep 20, 2016 11:03 am

Thank you. :D
Livecode Wiki: http://livecode.wikia.com
My blog: http://livecodeitalia.blogspot.it
To post code use this: http://tinyurl.com/ogp6d5w

seaniepie
Posts: 110
Joined: Wed Sep 07, 2011 10:56 am

Re: type alias definitions

Post by seaniepie » Sun Sep 25, 2016 4:06 pm

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.

PaulDaMacMan
Posts: 126
Joined: Wed Apr 24, 2013 4:53 pm

Re: type (SOLVED)

Post by PaulDaMacMan » Tue Sep 27, 2016 8:35 pm

^ 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.

seaniepie
Posts: 110
Joined: Wed Sep 07, 2011 10:56 am

Re: type (SOLVED)

Post by seaniepie » Wed Sep 28, 2016 9:15 pm

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:

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 5339
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: type (SOLVED)

Post by FourthWorld » Wed Sep 28, 2016 10:04 pm

Sean, forgive my ignorance of Objective-C, but what makes accessing libraries made with it prohibitively difficult from C++?
Richard Gaskin
Community volunteer LiveCode Community Liaison

LiveCode development, training, and consulting services: Fourth World Systems: http://FourthWorld.com
LiveCode User Group on Facebook : http://FaceBook.com/groups/LiveCodeUsers/

peter-b
Posts: 182
Joined: Thu Nov 20, 2014 2:14 pm
Location: LiveCode Ltd.

Re: type (SOLVED)

Post by peter-b » Wed Sep 28, 2016 10:20 pm

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.
LiveCode Open Source Team — @PeterTBBrett — peter.brett@livecode.com

Post Reply

Return to “LiveCode Builder”