Re: Fun (was Re: Cubist's first bug report)

2016-06-05 Thread Monte Goulding
> On 6 Jun 2016, at 3:15 PM, Dar Scott wrote: > > The problem is more general than the use of any and random(). It applies to > functions with side effects. > > And if the compiler is allowed to combine like-looking expressions (as in > your example), it should prove that

Re: Fun (was Re: Cubist's first bug report)

2016-06-05 Thread Dar Scott
The problem is more general than the use of any and random(). It applies to functions with side effects. And if the compiler is allowed to combine like-looking expressions (as in your example), it should prove that there can be no side effects. One solution would be to allow the building

Re: Fun (was Re: Cubist's first bug report)

2016-06-05 Thread Monte Goulding
> On 6 Jun 2016, at 12:47 PM, Mark Wieder wrote: > > Turns out an additional note was needed to cover "any". I am less concerned about the quirky behavior of any and random chunks considering it is easy to work around it than I am about the re-evaluation of the chunk

Re: Cubist's first bug report

2016-06-05 Thread FlexibleLearning.com
This double-evaluation bug has existed since MC v4.2 (the earliest engine I have immediately to hand). [snip] on mouseUp put "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16" into myVar repeat 1000 add zero to any item of myVar end repeat put myVar end mouseUp [/snip] Hugh Senior FLCo

Re: Feature Exchange any one?

2016-06-05 Thread Paul Dupuis
On 6/5/2016 7:17 PM, Monte Goulding wrote: >> On 6 Jun 2016, at 8:29 AM, Ali Lloyd wrote: >> >> Thanks for this Paul, I have taken the liberty of tweaking it slightly more >> and submitted a pull request: >> >> https://github.com/livecode/livecode-ide/pull/1218/files >> >>

Re: Fun (was Re: Cubist's first bug report)

2016-06-05 Thread Mark Wieder
On 06/05/2016 05:04 PM, Monte Goulding wrote: I suspect not. I didn't realise one was open ;-) Turns out an additional note was needed to cover "any". http://quality.livecode.com/show_bug.cgi?id=7919 http://quality.livecode.com/show_bug.cgi?id=17795 -- Mark Wieder ahsoftw...@gmail.com

Re: Fun (was Re: Cubist's first bug report)

2016-06-05 Thread Mark Wieder
On 06/05/2016 05:00 PM, Dar Scott wrote: I missed Mark's comment. Sorry about poking at this while it was actually understood. Actually, I thought you came up with some very interesting nuances. These should make it into the test suite. -- Mark Wieder ahsoftw...@gmail.com

Re: Cubist's first bug report

2016-06-05 Thread J. Landman Gay
For me, the problem is that there isn't a separate keyword column so there isn't a list you can scan down. Keywords, glossary entries, and syntax examples are all treated equally in a single column so it's too easy to miss things. I think the separations in the old dictionary made it easier to

Re: Fun (was Re: Cubist's first bug report)

2016-06-05 Thread Monte Goulding
I suspect not. I didn't realise one was open ;-) Sent from my iPhone > On 6 Jun 2016, at 9:52 AM, Mark Wieder wrote: > > There are two bug reports on this already. Do you need a third? ___ use-livecode mailing list

Re: Fun (was Re: Cubist's first bug report)

2016-06-05 Thread Dar Scott
> On Jun 5, 2016, at 5:52 PM, Mark Wieder wrote: > > Yes, I believe that's the gist of LCMark's comment in the bug report. Ah, looks like they have it on the run. I missed Mark's comment. Sorry about poking at this while it was actually understood. Dar

Re: Fun (was Re: Cubist's first bug report)

2016-06-05 Thread Mark Wieder
On 06/05/2016 04:03 PM, Monte Goulding wrote: I’ve taken a little look into it and yes it does appear the chunk is being evaluated twice: Yes, I believe that's the gist of LCMark's comment in the bug report. Please submit a bug report so we can look into it further... There are two bug

Re: Feature Exchange any one?

2016-06-05 Thread Monte Goulding
> On 6 Jun 2016, at 8:29 AM, Ali Lloyd wrote: > > Thanks for this Paul, I have taken the liberty of tweaking it slightly more > and submitted a pull request: > > https://github.com/livecode/livecode-ide/pull/1218/files > > Now all we need to do is convert the guide to

Re: Cubist's first bug report

2016-06-05 Thread Jerry Jensen
I suspect that is what happened to me too. Now I see it. Embarrasing, me calling it useless. Apologies. I then got trapped in the filters and couldn’t get out. .Jerry > On Jun 5, 2016, at 3:45 PM, ** Clarence P Martin ** > wrote: > > Thanks Dar, > I also just found it.

Re: Fun (was Re: Cubist's first bug report)

2016-06-05 Thread Monte Goulding
> On 6 Jun 2016, at 6:06 AM, d...@swcp.com wrote: > > I suspect that random(16) is being evaluated twice based on a first glance > at the pattern. I’ve taken a little look into it and yes it does appear the chunk is being evaluated twice: Add left to right - get value to add by and

RE: Cubist's first bug report

2016-06-05 Thread ** Clarence P Martin **
Thanks Dar, I also just found it. I guess I didn't see it because it is the first entry, at the top of the list, just as you noted. The old saying "Can't see the forest from the trees" is at play here. Sincerely, Clarence Martin Email: chi...@themartinz.com Cell: 626 6965561 -Original

Re: Feature Exchange any one?

2016-06-05 Thread Ali Lloyd
Thanks for this Paul, I have taken the liberty of tweaking it slightly more and submitted a pull request: https://github.com/livecode/livecode-ide/pull/1218/files Now all we need to do is convert the guide to markdown ;-) On Sat, Jun 4, 2016 at 8:26 PM Paul Dupuis wrote:

Re: Fun (was Re: Cubist's first bug report)

2016-06-05 Thread Dar Scott
> On Jun 5, 2016, at 2:26 PM, [-hh] wrote: > > And this, not this much funny, creates a CRASH (showing "inf"): > on mouseUp > put "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16" into myVar > repeat 1000 >add 1 to item (any item of myVar) of myVar > end repeat > put myVar

Re: Cubist's first bug report

2016-06-05 Thread Dar Scott
I opened the dictionary. I didn't need to select the API tab or the LiveCode Script API, those were selected. I typed "any" in the search box, but did not hit return or click the search button. A list containing "mobilPickMedia" showed up. Right above it, all by itself so it can be lost, is

Re: Cubist's first bug report

2016-06-05 Thread Fraser Gordon
On 05/06/16 23:06, Jerry Jensen wrote: I just spent a few minutes in the 8.0.1 dictionary and did not find it. That thing is useless! Maybe its because I’m new to 8, but where is “any" documented? How in the world does one find it? .Jerry

Re: Cubist's first bug report

2016-06-05 Thread Jerry Jensen
I just spent a few minutes in the 8.0.1 dictionary and did not find it. That thing is useless! Maybe its because I’m new to 8, but where is “any" documented? How in the world does one find it? .Jerry > On Jun 5, 2016, at 2:50 PM, ** Clarence P Martin ** > wrote: > > I

Re: Cubist's first bug report

2016-06-05 Thread Dar Scott
The word 'any' is in the dictionary. Well, it is in mine. It can apply to a chunk, a control or a card. A randomly selected thing is used. You can also use the function random() and 'the number of' to do the same thing. Also available are 'first' and 'last'. > On Jun 5, 2016, at 3:50

RE: Cubist's first bug report

2016-06-05 Thread ** Clarence P Martin **
I feel that I am somewhere in another world. Can someone please explain to me where the "Any Item" or even Just the command "Any" is documented? I can't seem to find this. Sorry if this sounds like a stupid question, but when I see something that is new to me, I have to explore it and its uses.

Re: Fun (was Re: Cubist's first bug report)

2016-06-05 Thread [-hh]
Dar Scott wrote > on mouseUp >put "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16" into myVar >repeat 1000 > add zero to any item of myVar >end repeat >put myVar > end mouseUp Your example is really convincing, nothing to say more. This introduces, still funny, some variation: on

Re: Fun (was Re: Cubist's first bug report)

2016-06-05 Thread dsc
on mouseUp put "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16" into myVar repeat 1000 add zero to any item of myVar end repeat put myVar end mouseUp > On Jun 5, 2016, at 2:06 PM, d...@swcp.com wrote: > > Just for fun: > > on mouseUp > put LF into newLine > put 0 into

Fun (was Re: Cubist's first bug report)

2016-06-05 Thread dsc
Just for fun: on mouseUp put LF into newLine put 0 into sRandomCount put "1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16" into myVar repeat 100 add zero to any item of myVar put myVar & newLine after myTempList end repeat put sum(myVar) & newLine & myTempList end mouseUp

Re: Cubist's first bug report

2016-06-05 Thread dsc
Here's a script (derived from Mark's) that illustrates the double call: local sRandomCount on mouseUp put LF into newLine put 0 into sRandomCount put "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" into myVar repeat 100 add 1 to item myrandom(16) of myVar

Re: Cubist's first bug report

2016-06-05 Thread Dar Scott
Very good test! I mentioned in crossed email that I suspect reevaluation. Since the problem shows up with item and not array subscripts, I would suspect the reevaluation is done to avoid some problem. Even so, the item number should be computed once and saved even if the character location

Re: Cubist's first bug report

2016-06-05 Thread Dar Scott
Very nice and clean example code. Also, as you hinted, this does have the problem: add 1 to item random(16) of myVar I infer from this that the problem is very likely not in how 'any' counts items. This also applies to subtract and multiply. I suspect that random(16) is being

Re: Cubist's first bug report

2016-06-05 Thread [-hh]
What's the culprit for that? I dare say: = It's not the random (as Mark S. proved with his example) = It's not a random-incompatible "add" (see example below) It is the basic problem that LC has with counting items, lines, words or other chunks. The number of is defined in a logically

Re: Cubist's first bug report

2016-06-05 Thread Mark Schonewille
Hi Quentin, I see the same results, when I try your code. However, if I first store the random value and add 1 to an item in the string in the next line in the script, it works correctly. Apparently, the random function and the add command are incompatible. on mouseUp put

Re: Cubist's first bug report

2016-06-05 Thread Mark Wieder
On 06/05/2016 07:12 AM, Quentin Long wrote: This handler *should* end up generating a 16-item string of integers which sum to exactly 100. What it *actually does* end up generating, is a 16-item string of integers whose sum may or may not fall somewhere within the range 80-120. Not sure what

Cubist's first bug report

2016-06-05 Thread Quentin Long
Code which exhibits the bug: on mouseUp put "0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0" into Fred repeat 100 times add 1 to any item of Fred put Fred into line (1 + the number of lines in fld "testbed") of fld "testbed" end repeat put sum (Fred) into line (1 + the number of lines