Re: What If... scenario for Open Source Livecode

2013-02-11 Thread Heather Laine
Yes, there is a maximum amount for any one pledge, by one person. Kickstarter 
is a crowd funding site, and it is set up so that venture capitalists cannot 
simply contribute the balance and take control of a project.

So we need everyone to contribute something. 

Regards,

(and thanks to everyone who has contributed so far!)

Heather


On 11 Feb 2013, at 05:29, Richmond wrote:

> On 02/11/2013 05:42 AM, Colin Holgate wrote:
>> Kickstarter pledges are a certain amount, or more, aren't they? If someone 
>> donated 76.1% of the money today, that ought to be accepted automatically.
> 
> Why do I have a funny feeling if a company like Apple or Microsoft did that 
> there would be
> unacceptable conditions attached that would compromise the open-source-ness 
> of the
> thing?
> 
> If one goes and has a look why LibreOffice was forked from Open Office Org . 
> . . .
> 
>> 
>> 
>> On Feb 10, 2013, at 10:36 PM, Alejandro Tejada  
>> wrote:
>> 
>>> What if February 28th a big company like Apple decides to contribute
>>> all the money left to complete the target of 350,000?
>>> 
>>> Will RunRev accept such donation to open source Livecode?
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription 
>> preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode

Heather Laine
Customer Services Manager
http://www.runrev.com/
Support Open Source LiveCode on Kickstarter
http://www.kickstarter.com/projects/1755283828/open-source-edition-of-livecode






___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What If... scenario for Open Source Livecode

2013-02-10 Thread Richmond

On 02/11/2013 05:42 AM, Colin Holgate wrote:

Kickstarter pledges are a certain amount, or more, aren't they? If someone 
donated 76.1% of the money today, that ought to be accepted automatically.


Why do I have a funny feeling if a company like Apple or Microsoft did 
that there would be
unacceptable conditions attached that would compromise the 
open-source-ness of the

thing?

If one goes and has a look why LibreOffice was forked from Open Office 
Org . . . .





On Feb 10, 2013, at 10:36 PM, Alejandro Tejada  wrote:


What if February 28th a big company like Apple decides to contribute
all the money left to complete the target of 350,000?

Will RunRev accept such donation to open source Livecode?

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode



___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What If... scenario for Open Source Livecode

2013-02-10 Thread Glen Bojsza
I believe that there is a limit of a maximum pledge of $10,000.



On Sun, Feb 10, 2013 at 10:42 PM, Colin Holgate  wrote:

> Kickstarter pledges are a certain amount, or more, aren't they? If someone
> donated 76.1% of the money today, that ought to be accepted automatically.
>
>
> On Feb 10, 2013, at 10:36 PM, Alejandro Tejada 
> wrote:
>
> > What if February 28th a big company like Apple decides to contribute
> > all the money left to complete the target of 350,000?
> >
> > Will RunRev accept such donation to open source Livecode?
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What If... scenario for Open Source Livecode

2013-02-10 Thread Colin Holgate
Kickstarter pledges are a certain amount, or more, aren't they? If someone 
donated 76.1% of the money today, that ought to be accepted automatically.


On Feb 10, 2013, at 10:36 PM, Alejandro Tejada  wrote:

> What if February 28th a big company like Apple decides to contribute
> all the money left to complete the target of 350,000?
> 
> Will RunRev accept such donation to open source Livecode?

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-29 Thread Peter M. Brigham
Oh, right. 

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig

On Jan 29, 2013, at 5:15 PM, Alex Tweedly wrote:

> On 29/01/2013 20:31, Peter M. Brigham wrote:
>> ... With an expression that is exclusively "ands" the first one that 
>> evaluates to false settles the value of the expression as false, and the 
>> engine stops there and returns the value. With "or" expressions, all the 
>> clauses have to be checked in order to decide the value.
>> 
>> 
> 
> 
> Not true :-)
> 
> With "or" expressions, as soon as one clause is true, the whole expression is 
> true - so evaluation can cease.
> 
> -- Alex.
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-29 Thread Alex Tweedly

On 29/01/2013 20:31, Peter M. Brigham wrote:

... With an expression that is exclusively "ands" the first one that evaluates to false 
settles the value of the expression as false, and the engine stops there and returns the value. 
With "or" expressions, all the clauses have to be checked in order to decide the value.





Not true :-)

With "or" expressions, as soon as one clause is true, the whole 
expression is true - so evaluation can cease.


-- Alex.

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-29 Thread Peter M. Brigham
Well, both "and and "or" expressions are one expression, but you are right that 
my comment only applies to the "and" operator. The engine is very parsimonious 
and quits when it has enough info to evaluate the expression. With an 
expression that is exclusively "ands" the first one that evaluates to false 
settles the value of the expression as false, and the engine stops there and 
returns the value. With "or" expressions, all the clauses have to be checked in 
order to decide the value.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig


On Jan 29, 2013, at 3:11 PM, Robert Sneidar wrote:

> I believe if you change that to or, you will throw an error. Or at least you 
> should! Thinking about this, it may be simpler to think of AND comparisons a 
> single expressions and OR comparisons as delimiting multiple expressions. In 
> a SINGLE LOGICAL EXPRESSION evaluation will terminate when a false is 
> encountered. If you think of what comes after OR as a NEW LOGICAL EXPRESSION 
> it all makes perfect sense. To my twisted brain anyway. 
> 
> Bob
> 
> 
> On Jan 29, 2013, at 10:45 AM, Peter M. Brigham wrote:
> 
>> One situation when the order of evaluation is important is if you have 
>> conditions that limit the scope of a general handler, eg:
>> 
>> if "field" is in the target and the locktext of the target = true then…
> 
> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-29 Thread Robert Sneidar
I believe if you change that to or, you will throw an error. Or at least you 
should! Thinking about this, it may be simpler to think of AND comparisons a 
single expressions and OR comparisons as delimiting multiple expressions. In a 
SINGLE LOGICAL EXPRESSION evaluation will terminate when a false is 
encountered. If you think of what comes after OR as a NEW LOGICAL EXPRESSION it 
all makes perfect sense. To my twisted brain anyway. 

Bob


On Jan 29, 2013, at 10:45 AM, Peter M. Brigham wrote:

> One situation when the order of evaluation is important is if you have 
> conditions that limit the scope of a general handler, eg:
> 
> if "field" is in the target and the locktext of the target = true then…


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-29 Thread Robert Sneidar
if false and false or true then

becomes:
if (false and false) or true then

becomes:
if false or true then

becomes:
if true then
answer "Got it 4!"

You are thinking of false and true as individual statements and they are not. 
The whole condition is one statement. 

Or if you like, the ands are one statement, which evaluates to false, and then 
there is a new statement to evaluate: false or true. Either way it works. 

Bob


On Jan 28, 2013, at 11:56 PM, Paul Hibbert wrote:

> 
> On 2013-01-28, at 11:40 PM, Thierry Douez wrote:
> 
>> don't have to check for each sub-condition  if it is true, for instance:
> 
> Maybe I'm wrong, but the way I read statement 4, the first condition is false 
> (if false and false) so the if statement continues to the second condition 
> (or true) and returns "true".
> 
> I thought in this case the If statement will stop on a true statement but not 
> on a false (unless that is what you specify).
> 
> e.g. if false and false or true is false then ## = False
> 
> Paul
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-29 Thread Robert Sneidar
It's order of precedence. AND before OR. 

Bob


On Jan 28, 2013, at 9:33 PM, Thierry Douez wrote:

> Hi Jacques,
> 
> Thanks for testing.
> 
> Umm, I don't have the correct answers.
> 
> The first test gives me False, which should be the same
> as the fourth case which gives True!
> 
> Or, did I miss something ?
> 
> Thierry
> 
> 2013/1/28 J. Landman Gay 
> 
>> On 1/28/13 6:36 AM, Thierry Douez wrote:
>> 
>> So, smart livecoders, try to guess what would be the 4 answers to this
>>> script;
>>> then run it and thanks to comment :)
>>> 
>>> 
>>> on mouseUp
>>>if false or true and false then
>>>   answer "Got it 1!"
>>>else
>>>   answer "False 1!"
>>>end if
>>>if false or (true and false) then
>>>   answer "Got it 2!"
>>>else
>>>   answer "False 2!"
>>>end if
>>>if false or true then
>>>   answer "Got it 3!"
>>>else
>>>   answer "False 3!"
>>>end if
>>>if false and false or true then
>>>   answer "Got it 4!"
>>>else
>>>   answer "False 4!"
>>>end if
>>> end mouseUp
>>> 
>> 
>> Got them all correct the first time. :P
>> 
>> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-29 Thread Robert Sneidar
False 1!
False 2!
Got it 3!
Got it 4!

Off the top of my head. 

Bob


On Jan 28, 2013, at 4:36 AM, Thierry Douez wrote:

> Hi Peter,
> 
> 2013/1/27 Peter Haworth 
> 
>> Musings about complex if statements on this Sunday morning...
>> 
>> if cond1 and cond2 and cond3 and cond4 then.
>> 
>> if cond1 then
>>   if cond2 then
>>  if cond3 then
>> if cond4 then...
>> 
>> if cond1 and cond2 and (cond3 and cond4) then
>> 
>> Just curious.
>> Pete
>> 
> 
> Wanting to show you in few lines of code, some differences with or wihtout
> the (),
> I came accros this interesting riddle...
> 
> So, smart livecoders, try to guess what would be the 4 answers to this
> script;
> then run it and thanks to comment :)
> 
> 
> on mouseUp
>   if false or true and false then
>  answer "Got it 1!"
>   else
>  answer "False 1!"
>   end if
>   if false or (true and false) then
>  answer "Got it 2!"
>   else
>  answer "False 2!"
>   end if
>   if false or true then
>  answer "Got it 3!"
>   else
>  answer "False 3!"
>   end if
>   if false and false or true then
>  answer "Got it 4!"
>   else
>  answer "False 4!"
>   end if
> end mouseUp
> 
> 
> Regards,
> 
> Thierry
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-29 Thread Robert Sneidar
I should rephrase that. If condition 1 and/or 2 involve long time consuming 
evaluations, there would be an advantage the putting conditions 3 and 4 in 
parens, since they would be evaluated first, saving time in some instances. But 
the way to do that is put your time consuming evaluations last where they will 
be evaluated last by natural order.

Bob


> Doesn't matter. It's like saying 1 + 2 + (3 + 4). That is why they use + as 
> the AND operator in boolean logic. 
> 
> Bob
> 
> 
> On Jan 27, 2013, at 10:39 AM, Peter Haworth wrote:
> 
>> The manual says the grouping operator (parens) has the highest precedence
>> so does this mean (cond3 and cond4) will be evaluated before cond1 and
>> cond2?
>> 
>> Just curious.
> 

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-29 Thread Robert Sneidar
Doesn't matter. It's like saying 1 + 2 + (3 + 4). That is why they use + as the 
AND operator in boolean logic. 

Bob


On Jan 27, 2013, at 10:39 AM, Peter Haworth wrote:

> The manual says the grouping operator (parens) has the highest precedence
> so does this mean (cond3 and cond4) will be evaluated before cond1 and
> cond2?
> 
> Just curious.


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-29 Thread Robert Sneidar
Yes. You can do stuff in between the conditionals in example 2 whereas you 
cannot in example one. 

Bob


On Jan 27, 2013, at 10:39 AM, Peter Haworth wrote:

> Musings about complex if statements on this Sunday morning
> 
> Lets say you have a complex if statement with 4 conditions that must all be
> true.  Is there any advantage, other than personal preference/style, to:
> 
> if cond1 and cond2 and cond3 and cond4 then.
> 
> or
> 
> if cond1 then
>   if cond2 then
>  if cond3 then
> if cond4 then...
> 
> In either case, as soon as a condition evaluates to false, none of the rest
> are evaluated, right?  If so, then always best to put the conditions that
> take the longest to evaluate further down the list, for example perhaps an
> SQL SELECT statement that might take a while to execute?  But then what if
> some of the conditions are in parens, for example:
> 
> if cond1 and cond2 and (cond3 and cond4) then
> 
> The manual says the grouping operator (parens) has the highest precedence
> so does this mean (cond3 and cond4) will be evaluated before cond1 and
> cond2?
> 
> Just curious.
> 
> 
> Pete
> lcSQL Software 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-29 Thread Peter M. Brigham
One situation when the order of evaluation is important is if you have 
conditions that limit the scope of a general handler, eg:

if "field" is in the target and the locktext of the target = true then…

In this case the first clause is evaluated first, and if the target is 
something other than a field, the second clause is skipped and you avoid 
throwing an error. With the clauses switched in order, you throw an error if 
the target is, eg, a button.

I used to nest if statements:

if "field" is in the target then
   if the locktext of the target = true then…

... until I realized I could do it all in one line.

-- Peter

Peter M. Brigham
pmb...@gmail.com
http://home.comcast.net/~pmbrig

On Jan 27, 2013, at 1:39 PM, Peter Haworth wrote:

> Musings about complex if statements on this Sunday morning
> 
> Lets say you have a complex if statement with 4 conditions that must all be
> true.  Is there any advantage, other than personal preference/style, to:
> 
> if cond1 and cond2 and cond3 and cond4 then.
> 
> or
> 
> if cond1 then
>   if cond2 then
>  if cond3 then
> if cond4 then...
> 
> In either case, as soon as a condition evaluates to false, none of the rest
> are evaluated, right?  If so, then always best to put the conditions that
> take the longest to evaluate further down the list, for example perhaps an
> SQL SELECT statement that might take a while to execute?  But then what if
> some of the conditions are in parens, for example:
> 
> if cond1 and cond2 and (cond3 and cond4) then
> 
> The manual says the grouping operator (parens) has the highest precedence
> so does this mean (cond3 and cond4) will be evaluated before cond1 and
> cond2?
> 
> Just curious.
> 
> 
> Pete
> lcSQL Software 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-29 Thread Thierry Douez
2013/1/29 Paul Hibbert 

Sorry, just re-read your reply and realised I skipped this,
>


At last, I get it.

My concern was not about how you write the if in LC, but about
the evaluation of the logical expressions,  the order of precedence
and commutativity.

Obviously, I was wrong. case 1 and case 4 are 2 different expressions
with 2 different results.

Thanks all for your answers.

Regards,

Thierry
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-29 Thread Paul Hibbert

On 2013-01-28, at 11:40 PM, Thierry Douez wrote:

> which with my little understanding they should not (case 1 should be true) !

Sorry, just re-read your reply and realised I skipped this,

  if false or true and false then

Condition 1 (if false) returns false
Condition 2 (true AND false) also returns false

>From memory (like 30 years ago!) when programming in Basic we used to put 
>operators in caps and it did help with working out problems like this.

Paul
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-28 Thread Paul Hibbert

On 2013-01-28, at 11:40 PM, Thierry Douez wrote:

> don't have to check for each sub-condition  if it is true, for instance:

Maybe I'm wrong, but the way I read statement 4, the first condition is false 
(if false and false) so the if statement continues to the second condition (or 
true) and returns "true".

I thought in this case the If statement will stop on a true statement but not 
on a false (unless that is what you specify).

e.g. if false and false or true is false then ## = False

Paul
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-28 Thread Thierry Douez
2013/1/29 Paul Hibbert 

> Thierry,
>
> Just fill in the blanks!
>

Hi Paul,

Thanks for your tries.

But...

After an if , there is a condition which is true or false;
don't have to check for each sub-condition  if it is true, for instance:

put true into test
if test then put "Ok"

  is the same as

if test is true then put "Ok"

and anyway, doesn't change the fact that case 1 and 4 have different
results,
which with my little understanding they should not (case 1 should be true) !


Regards,

Thierry



> on mouseUp
>   if false is true or true is true and false is true then ## = False
>  answer "Got it 1!"
>   else
>  answer "False 1!"
>   end if
>   if false is true or (true is true and false is true) then ## = False
>  answer "Got it 2!"
>   else
>  answer "False 2!"
>   end if
>   if false is true or true is true then ## = True
>  answer "Got it 3!"
>   else
>  answer "False 3!"
>   end if
>   if false is true and false is true or true is true then ## = True
>  answer "Got it 4!"
>   else
>  answer "False 4!"
>   end if
> end mouseUp
>
> Paul
>
>
> On 2013-01-28, at 9:33 PM, Thierry Douez wrote:
>
> > Hi Jacques,
> >
> > Thanks for testing.
> >
> > Umm, I don't have the correct answers.
> >
> > The first test gives me False, which should be the same
> > as the fourth case which gives True!
> >
> > Or, did I miss something ?
> >
> > Thierry
> >
> > 2013/1/28 J. Landman Gay 
> >
> >> On 1/28/13 6:36 AM, Thierry Douez wrote:
> >>
> >> So, smart livecoders, try to guess what would be the 4 answers to this
> >>> script;
> >>> then run it and thanks to comment :)
> >>>
> >>>
> >>> on mouseUp
> >>>if false or true and false then
> >>>   answer "Got it 1!"
> >>>else
> >>>   answer "False 1!"
> >>>end if
> >>>if false or (true and false) then
> >>>   answer "Got it 2!"
> >>>else
> >>>   answer "False 2!"
> >>>end if
> >>>if false or true then
> >>>   answer "Got it 3!"
> >>>else
> >>>   answer "False 3!"
> >>>end if
> >>>if false and false or true then
> >>>   answer "Got it 4!"
> >>>else
> >>>   answer "False 4!"
> >>>end if
> >>> end mouseUp
> >>>
> >>
> >> Got them all correct the first time. :P
> >>
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-28 Thread Paul Hibbert
Thierry,

Just fill in the blanks!

on mouseUp
  if false is true or true is true and false is true then ## = False
 answer "Got it 1!"
  else
 answer "False 1!"
  end if
  if false is true or (true is true and false is true) then ## = False
 answer "Got it 2!"
  else
 answer "False 2!"
  end if
  if false is true or true is true then ## = True
 answer "Got it 3!"
  else
 answer "False 3!"
  end if
  if false is true and false is true or true is true then ## = True
 answer "Got it 4!"
  else
 answer "False 4!"
  end if
end mouseUp

Paul


On 2013-01-28, at 9:33 PM, Thierry Douez wrote:

> Hi Jacques,
> 
> Thanks for testing.
> 
> Umm, I don't have the correct answers.
> 
> The first test gives me False, which should be the same
> as the fourth case which gives True!
> 
> Or, did I miss something ?
> 
> Thierry
> 
> 2013/1/28 J. Landman Gay 
> 
>> On 1/28/13 6:36 AM, Thierry Douez wrote:
>> 
>> So, smart livecoders, try to guess what would be the 4 answers to this
>>> script;
>>> then run it and thanks to comment :)
>>> 
>>> 
>>> on mouseUp
>>>if false or true and false then
>>>   answer "Got it 1!"
>>>else
>>>   answer "False 1!"
>>>end if
>>>if false or (true and false) then
>>>   answer "Got it 2!"
>>>else
>>>   answer "False 2!"
>>>end if
>>>if false or true then
>>>   answer "Got it 3!"
>>>else
>>>   answer "False 3!"
>>>end if
>>>if false and false or true then
>>>   answer "Got it 4!"
>>>else
>>>   answer "False 4!"
>>>end if
>>> end mouseUp
>>> 
>> 
>> Got them all correct the first time. :P
>> 
>> 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription 
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-28 Thread Thierry Douez
Hi Jacques,

Thanks for testing.

Umm, I don't have the correct answers.

The first test gives me False, which should be the same
as the fourth case which gives True!

Or, did I miss something ?

Thierry

2013/1/28 J. Landman Gay 

> On 1/28/13 6:36 AM, Thierry Douez wrote:
>
>  So, smart livecoders, try to guess what would be the 4 answers to this
>> script;
>> then run it and thanks to comment :)
>>
>>
>> on mouseUp
>> if false or true and false then
>>answer "Got it 1!"
>> else
>>answer "False 1!"
>> end if
>> if false or (true and false) then
>>answer "Got it 2!"
>> else
>>answer "False 2!"
>> end if
>> if false or true then
>>answer "Got it 3!"
>> else
>>answer "False 3!"
>> end if
>> if false and false or true then
>>answer "Got it 4!"
>> else
>>answer "False 4!"
>> end if
>> end mouseUp
>>
>
> Got them all correct the first time. :P
>
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-28 Thread J. Landman Gay

On 1/28/13 6:36 AM, Thierry Douez wrote:


So, smart livecoders, try to guess what would be the 4 answers to this
script;
then run it and thanks to comment :)


on mouseUp
if false or true and false then
   answer "Got it 1!"
else
   answer "False 1!"
end if
if false or (true and false) then
   answer "Got it 2!"
else
   answer "False 2!"
end if
if false or true then
   answer "Got it 3!"
else
   answer "False 3!"
end if
if false and false or true then
   answer "Got it 4!"
else
   answer "False 4!"
end if
end mouseUp


Got them all correct the first time. :P

--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-28 Thread Thierry Douez
Hi Peter,

2013/1/27 Peter Haworth 

> Musings about complex if statements on this Sunday morning...
>
> if cond1 and cond2 and cond3 and cond4 then.
>
> if cond1 then
>if cond2 then
>   if cond3 then
>  if cond4 then...
>
> if cond1 and cond2 and (cond3 and cond4) then
>
> Just curious.
> Pete
>

Wanting to show you in few lines of code, some differences with or wihtout
the (),
I came accros this interesting riddle...

So, smart livecoders, try to guess what would be the 4 answers to this
script;
then run it and thanks to comment :)


on mouseUp
   if false or true and false then
  answer "Got it 1!"
   else
  answer "False 1!"
   end if
   if false or (true and false) then
  answer "Got it 2!"
   else
  answer "False 2!"
   end if
   if false or true then
  answer "Got it 3!"
   else
  answer "False 3!"
   end if
   if false and false or true then
  answer "Got it 4!"
   else
  answer "False 4!"
   end if
end mouseUp


Regards,

Thierry
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-27 Thread Peter Haworth
Thanks Mark, sounds like a stye thing then.  I love it when real
programmers post on this list - what is DRY code?

Not really on topic, but whatever happened to decision table processors? I
used one years ago and found it to be a great way  to express complex if
statements and their related actions.

Pete
lcSQL Software 


On Sun, Jan 27, 2013 at 12:31 PM, Mark Wieder wrote:

> Pete-
>
> Sunday, January 27, 2013, 11:45:16 AM, you wrote:
>
> > OK, so I understand the parens thing now.  Any thoughts on the use of
> > multiple ifs vs joining the conditions together with "and".  I've
> > always considered that to be just a matter of personal preference and
> ease
> > of reading but wondering if there might be other implications, like
> > performance for example.
>
> No performance hits. They compile down to the same code. In some
> situations one may be easier to read than the other or vice versa. I
> usually use the separate lines form to make it easier to maintain if I
> have to add things. I also find that separating them this way makes it
> easier to write DRY code since conditions in common stand out more.
>
> --
> -Mark Wieder
>  mwie...@ahsoftware.net
>
>
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-27 Thread Mark Wieder
Pete-

Sunday, January 27, 2013, 11:45:16 AM, you wrote:

> OK, so I understand the parens thing now.  Any thoughts on the use of
> multiple ifs vs joining the conditions together with "and".  I've
> always considered that to be just a matter of personal preference and ease
> of reading but wondering if there might be other implications, like
> performance for example.

No performance hits. They compile down to the same code. In some
situations one may be easier to read than the other or vice versa. I
usually use the separate lines form to make it easier to maintain if I
have to add things. I also find that separating them this way makes it
easier to write DRY code since conditions in common stand out more.

-- 
-Mark Wieder
 mwie...@ahsoftware.net


___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-27 Thread Peter Haworth
OK, so I understand the parens thing now.  Any thoughts on the use of
multiple ifs vs joining the conditions together with "and".  I've
always considered that to be just a matter of personal preference and ease
of reading but wondering if there might be other implications, like
performance for example.

Pete
lcSQL Software 


On Sun, Jan 27, 2013 at 11:27 AM, J. Landman Gay
wrote:

> On 1/27/13 12:39 PM, Peter Haworth wrote:
>
>> Musings about complex if statements on this Sunday morning
>>
>> Lets say you have a complex if statement with 4 conditions that must all
>> be
>> true.  Is there any advantage, other than personal preference/style, to:
>>
>> if cond1 and cond2 and cond3 and cond4 then.
>>
>> or
>>
>> if cond1 then
>> if cond2 then
>>if cond3 then
>>   if cond4 then...
>>
>> In either case, as soon as a condition evaluates to false, none of the
>> rest
>> are evaluated, right?
>>
>
> Right, both examples are equivalent. In the single line version (example
> 1) the conditions are evaluated left to right, and as soon as one is false
> the rest are abandoned.
>
> Parentheses indicate which conditions are part of a grouping but don't
> influence the direction of evaluation.
>
> --
> Jacqueline Landman Gay | jac...@hyperactivesw.com
> HyperActive Software   | http://www.hyperactivesw.com
>
>
> __**_
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/**mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-27 Thread Peter Haworth
Interesting on the use of parens in this situation.  I guess it makes sense
it works the way it does but it doesn't really come across that way in the
manual.
Pete
lcSQL Software 


On Sun, Jan 27, 2013 at 10:53 AM, Mike Bonner  wrote:

> ifs are evaluated left to right, though there is some leeway using parens.
>
> As to your question though, yes putting slower evals at the end of a string
> of ands and ors does save time if the if fails before the slow parts.
>
> Did the following in a button to test. Just change one of the first
> conditions to be false and the long myfunc call is never hit.  Placed
> parens around the myfunc() to demonstrate that they don't give precedence
> in this situation.
>
> *on* mouseUp
>
>*if* 1 is 1 and 2 is 2 and (myfunc()) *then* *put* "It's all true"
>
> *end* mouseUp
>
>
> *function* myFunc
>
>*repeat* 1 times
>
>   *put* random(10)
>
>*end* *repeat*
>
>*if* random(2) is 1 *then*
>
>   *return* true
>
>*else*
>
>   *return* false
>
>*end* *if*
>
> *end* myFunc
>
>
>
> On Sun, Jan 27, 2013 at 11:39 AM, Peter Haworth  wrote:
>
> > Musings about complex if statements on this Sunday morning
> >
> > Lets say you have a complex if statement with 4 conditions that must all
> be
> > true.  Is there any advantage, other than personal preference/style, to:
> >
> > if cond1 and cond2 and cond3 and cond4 then.
> >
> > or
> >
> > if cond1 then
> >if cond2 then
> >   if cond3 then
> >  if cond4 then...
> >
> > In either case, as soon as a condition evaluates to false, none of the
> rest
> > are evaluated, right?  If so, then always best to put the conditions that
> > take the longest to evaluate further down the list, for example perhaps
> an
> > SQL SELECT statement that might take a while to execute?  But then what
> if
> > some of the conditions are in parens, for example:
> >
> > if cond1 and cond2 and (cond3 and cond4) then
> >
> > The manual says the grouping operator (parens) has the highest precedence
> > so does this mean (cond3 and cond4) will be evaluated before cond1 and
> > cond2?
> >
> > Just curious.
> >
> >
> > Pete
> > lcSQL Software 
> > ___
> > use-livecode mailing list
> > use-livecode@lists.runrev.com
> > Please visit this url to subscribe, unsubscribe and manage your
> > subscription preferences:
> > http://lists.runrev.com/mailman/listinfo/use-livecode
> >
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-27 Thread J. Landman Gay

On 1/27/13 12:39 PM, Peter Haworth wrote:

Musings about complex if statements on this Sunday morning

Lets say you have a complex if statement with 4 conditions that must all be
true.  Is there any advantage, other than personal preference/style, to:

if cond1 and cond2 and cond3 and cond4 then.

or

if cond1 then
if cond2 then
   if cond3 then
  if cond4 then...

In either case, as soon as a condition evaluates to false, none of the rest
are evaluated, right?


Right, both examples are equivalent. In the single line version (example 
1) the conditions are evaluated left to right, and as soon as one is 
false the rest are abandoned.


Parentheses indicate which conditions are part of a grouping but don't 
influence the direction of evaluation.


--
Jacqueline Landman Gay | jac...@hyperactivesw.com
HyperActive Software   | http://www.hyperactivesw.com

___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-27 Thread Mike Bonner
No real leeway with the parens, useful though to force the correct values
to be evaluated first though.


On Sun, Jan 27, 2013 at 11:53 AM, Mike Bonner  wrote:

> ifs are evaluated left to right, though there is some leeway using parens.
>
> As to your question though, yes putting slower evals at the end of a
> string of ands and ors does save time if the if fails before the slow parts.
>
> Did the following in a button to test. Just change one of the first
> conditions to be false and the long myfunc call is never hit.  Placed
> parens around the myfunc() to demonstrate that they don't give precedence
> in this situation.
>
> *on* mouseUp
>
>*if* 1 is 1 and 2 is 2 and (myfunc()) *then* *put* "It's all true"
>
> *end* mouseUp
>
>
> *function* myFunc
>
>*repeat* 1 times
>
>   *put* random(10)
>
>*end* *repeat*
>
>*if* random(2) is 1 *then*
>
>   *return* true
>
>*else*
>
>   *return* false
>
>*end* *if*
>
> *end* myFunc
>
>
>
> On Sun, Jan 27, 2013 at 11:39 AM, Peter Haworth  wrote:
>
>> Musings about complex if statements on this Sunday morning
>>
>> Lets say you have a complex if statement with 4 conditions that must all
>> be
>> true.  Is there any advantage, other than personal preference/style, to:
>>
>> if cond1 and cond2 and cond3 and cond4 then.
>>
>> or
>>
>> if cond1 then
>>if cond2 then
>>   if cond3 then
>>  if cond4 then...
>>
>> In either case, as soon as a condition evaluates to false, none of the
>> rest
>> are evaluated, right?  If so, then always best to put the conditions that
>> take the longest to evaluate further down the list, for example perhaps an
>> SQL SELECT statement that might take a while to execute?  But then what if
>> some of the conditions are in parens, for example:
>>
>> if cond1 and cond2 and (cond3 and cond4) then
>>
>> The manual says the grouping operator (parens) has the highest precedence
>> so does this mean (cond3 and cond4) will be evaluated before cond1 and
>> cond2?
>>
>> Just curious.
>>
>>
>> Pete
>> lcSQL Software 
>> ___
>> use-livecode mailing list
>> use-livecode@lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
>>
>
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode


Re: What if....

2013-01-27 Thread Mike Bonner
ifs are evaluated left to right, though there is some leeway using parens.

As to your question though, yes putting slower evals at the end of a string
of ands and ors does save time if the if fails before the slow parts.

Did the following in a button to test. Just change one of the first
conditions to be false and the long myfunc call is never hit.  Placed
parens around the myfunc() to demonstrate that they don't give precedence
in this situation.

*on* mouseUp

   *if* 1 is 1 and 2 is 2 and (myfunc()) *then* *put* "It's all true"

*end* mouseUp


*function* myFunc

   *repeat* 1 times

  *put* random(10)

   *end* *repeat*

   *if* random(2) is 1 *then*

  *return* true

   *else*

  *return* false

   *end* *if*

*end* myFunc



On Sun, Jan 27, 2013 at 11:39 AM, Peter Haworth  wrote:

> Musings about complex if statements on this Sunday morning
>
> Lets say you have a complex if statement with 4 conditions that must all be
> true.  Is there any advantage, other than personal preference/style, to:
>
> if cond1 and cond2 and cond3 and cond4 then.
>
> or
>
> if cond1 then
>if cond2 then
>   if cond3 then
>  if cond4 then...
>
> In either case, as soon as a condition evaluates to false, none of the rest
> are evaluated, right?  If so, then always best to put the conditions that
> take the longest to evaluate further down the list, for example perhaps an
> SQL SELECT statement that might take a while to execute?  But then what if
> some of the conditions are in parens, for example:
>
> if cond1 and cond2 and (cond3 and cond4) then
>
> The manual says the grouping operator (parens) has the highest precedence
> so does this mean (cond3 and cond4) will be evaluated before cond1 and
> cond2?
>
> Just curious.
>
>
> Pete
> lcSQL Software 
> ___
> use-livecode mailing list
> use-livecode@lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your
> subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
>
___
use-livecode mailing list
use-livecode@lists.runrev.com
Please visit this url to subscribe, unsubscribe and manage your subscription 
preferences:
http://lists.runrev.com/mailman/listinfo/use-livecode