set the layer of group

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

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

Re: set the layer of group

Post by FourthWorld » Thu Nov 24, 2022 8:01 am

jacque wrote:
Thu Nov 24, 2022 6:13 am
Look up "target" in the dictionary, there are two entries. One is the function, the other is a keyword. It's the keyword you want.
I don't doubt you, and I appreciate the pointer to the Dictionary entry. But it's weird. No less so by the choice to explain it away as "keyword", a sort of shorthand that winks to the reader as "We don't really understand how this fits into the language, so we're using the most generic term we have", handling a token ambiguity by assigning it a categorical ambiguity. :)

This discussion prompted me to wonder how the HC team described it. In HyperTalk 2.2: The Book they have no parenthetic form described in the main text*, only "the target" and "target", both handled under one entry categorized as a function.

Most of the entry is about "the target", and the only thing written there about "target" is:
If the target is a field or a button, the special form target return the contents of the field or button.
Given the oddity of the "target" form, I'd wager it might have been a bug that got left in and eventually rationalized for its utility.

I can imagine an internal debate about whether "the target" should return the object name or the object contents, not entirely wacky when we consider how hard they worked to make accessing field contents feel like natural language. So maybe both forms were implemented for testing, the shorter form a temporary placeholder while they were deciding what to do. When they finally decided to make "the target" uniformly return the object name rather than the contents, perhaps they just forgot to back out "target", and when discovered they just documented it with a one-liner tucked away in the entry for "the target" and moved on hoping no one would think too hard about it. :)

But here we are. I can't not think about it. Because it's weird. Maybe weird enough to have achieved a closer match to natural language than even they'd intended, with all the gotchas, "sometimes" rules, and long-forgotten etymology of English.

* There is a footnote at the end of the entry which says: "In versions before 2.0, you can also use the form target(). However, because of a bug, the form target() causes an error when the target is a field."
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: set the layer of group

Post by richmond62 » Thu Nov 24, 2022 9:07 am

But it's weird.
Not really, as LiveCode contains quite a few inconsistencies (and, to be fair, you would be hard put
to find any programming language that does not contain inconsistencies).

What is possibly overlooked by some folk is that computer languages, while developed to talk to coldly logical
computers are not designed by coldly logical computers, but by warm illogical human beings; so expecting
a programming language not to exhibit inconsistencies is a bit silly.

I have, in the past, pointed out that 'having one's eye on the prize' can result in other things
being overlooked.
with all the gotchas, "sometimes" rules, and long-forgotten etymology of English
That is one of the reasons why other programming languages don't look 'natural' insofar as they do not
attempt to approach human language (as LiveCode does): obviously you cannot have it both ways:
they easy and clear scripts of LiveCode and the logical but opaque scripts of, say, ALGOL:

"procedure Absmax(a) Size:(n, m) Result:(y) Subscripts:(i, k);
value n, m; array a; integer n, m, i, k; real y;
begin
integer p, q;
y := 0; i := k := 1;
for p := 1 step 1 until n do
for q := 1 step 1 until m do
if abs(a[p, q]) > y then
begin y := abs(a[p, q]);
i := p; k := q
end
end Absmax"

And, even that, does not look totally non-human. 8)

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

Re: set the layer of group

Post by FourthWorld » Thu Nov 24, 2022 9:50 am

Natural languages are for expressing the richness of the human experience to other people.

Programming languages are lists of instructions for machines.

I don't mind when they're different. They serve very different purposes.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9359
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: set the layer of group

Post by richmond62 » Thu Nov 24, 2022 10:06 am

They do serve different purposes, but as both types of language are man-made they
are prone to human inconsistency.

In a perfect world computer languages would not contain inconsistencies, which might
make things easier for programmers: but can you imagine how nauseating a perfect
world would be.

The other day I found an unfortunate and unsuspected inconsistency in my Devawriter Pro,
and had to spend about 6 hours removing it and issuing new builds: and that was 100% my
fault and I am not going to be so cheap as to blame that on LiveCode. What it did do was
make me realise I shouldn't be such a smug whatsit re my Devawriter Pro and make
several unfounded claims about it, just as many people do about many things elsewhere.

Now if I cannot produce something entirely consistent myself I really don't have a leg to
stand on if I criticise LiveCode (or anything else) for being inconsistent.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9648
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: set the layer of group

Post by dunbarx » Thu Nov 24, 2022 4:48 pm

Richard.

You are essentially saying that "target" could (should?) be replaced with "the value of the target"?

Craig

stam
Posts: 2679
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: set the layer of group

Post by stam » Thu Nov 24, 2022 5:23 pm

I must say that would be a lot less helpful.
Almost always I use the target because I want to trigger an action based on what is clicked, not because I need the content of the clicked object,which in any case is available if you know what you clicked…

Leave the target alone!

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9648
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: set the layer of group

Post by dunbarx » Thu Nov 24, 2022 6:37 pm

Stam.

I don't think anyone here would touch "the target", one of the most unique features of xTalk, and a testimony to the genius of HC (and LC), in that it embodies the "live" aspect of such programs.

Same for "target", that is, er, the target of this thread.

Leave them both alone; neither ever confused me, though they might a very new user. I use both all the time. So powerful, compact and convenient.

Craig

stam
Posts: 2679
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: set the layer of group

Post by stam » Thu Nov 24, 2022 8:12 pm

My comment was made tongue-in-cheek in case that wasn't clear ;)

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9648
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: set the layer of group

Post by dunbarx » Fri Nov 25, 2022 6:06 pm

@Stam. I was not addressing you in particular. I am actually surprised that this discussion exists at all, that something as lovely as "target" is even considered being placed in the dock, likely on trumped-up charges.

@Richmond. The way you replied about my pontificating seems as if you had someone else in particular in mind. Ever since Amthony Black went away, I cannot imagine who else might qualify. :shock:

Craig

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

Re: set the layer of group

Post by FourthWorld » Fri Nov 25, 2022 7:27 pm

dunbarx wrote:
Fri Nov 25, 2022 6:06 pm
I am actually surprised that this discussion exists at all, that something as lovely as "target" is even considered being placed in the dock, likely on trumped-up charges.
For my own part, I recognize that no matter how anomalous "target" is as a shorthand for "the text of the target", my only disciplinary action is directed at myself: I will forget that I ever heard of it, as part of a process that also includes exercise and leafy greens, to postpone any risk of dementia. :)

It's actually impressive that Dr Raney showed the thoroughness to implement that HC oddity, erring as he so often did on the side of completeness where practical.

And it's been around so long that there's no value in suggesting deprecation.

For myself, it's like the "the" form of functions: it exists, but not consistently, so I rarely use it and even more rarely teach it.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7229
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: set the layer of group

Post by jacque » Fri Nov 25, 2022 8:05 pm

FourthWorld wrote:
Fri Nov 25, 2022 7:27 pm
And it's been around so long that there's no value in suggesting deprecation.
Not only that, but since no one apparently remembers it but me, there's probably no reason to do anything with it at all. No one uses it.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9648
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: set the layer of group

Post by dunbarx » Fri Nov 25, 2022 9:12 pm

Jacque.

I use it all the time. As I mentioned a handful of posts up: "So powerful, compact and convenient."

And short. I suspect that Richard intends to pretend it does not exist because of its odd form. Nowhere else in HC or LC, apart form a variable name, can one, say, "get target". That is because it is a keyWord, not a function or property.

Craig

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”