Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #32357 > unrolled thread
| Started by | jonas.thornvall@gmail.com |
|---|---|
| First post | 2017-01-26 10:39 -0800 |
| Last post | 2017-01-27 13:36 +0100 |
| Articles | 20 on this page of 56 — 9 participants |
Back to article view | Back to comp.lang.javascript
Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-26 10:39 -0800
Re: Logic problem, i always had problem translate until statements into while Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-26 20:28 +0000
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-26 13:24 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-26 13:33 -0800
Re: Logic problem, i always had problem translate until statements into while Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-26 23:06 +0000
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 01:33 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 01:57 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 02:17 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 02:35 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 02:39 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 02:43 -0800
Re: Logic problem, i always had problem translate until statements into while Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-27 11:23 +0000
Re: Logic problem, i always had problem translate until statements into while Tim Streater <timstreater@greenbee.net> - 2017-01-27 12:14 +0000
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 08:00 -0800
Re: Logic problem, i always had problem translate until statements into while Gene Wirchenko <genew@telus.net> - 2017-01-27 09:29 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 10:43 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 10:44 -0800
Re: Logic problem, i always had problem translate until statements into while Gene Wirchenko <genew@telus.net> - 2017-01-27 15:46 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 18:20 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 18:34 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 18:51 -0800
Re: Logic problem, i always had problem translate until statements into while John Harris <niam@jghnorth.org.uk.invalid> - 2017-01-28 10:07 +0000
Re: Logic problem, i always had problem translate until statements into while Gene Wirchenko <genew@telus.net> - 2017-01-30 09:14 -0800
Re: Logic problem, i always had problem translate until statements into while "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-28 10:48 +0100
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-28 05:05 -0800
Re: Logic problem, i always had problem translate until statements into while "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-27 13:43 +0100
Re: Logic problem, i always had problem translate until statements into while Scott Sauyet <scott.sauyet@gmail.com> - 2017-01-27 19:52 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 22:25 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 22:36 -0800
Re: Logic problem, i always had problem translate until statements into while Scott Sauyet <scott.sauyet@gmail.com> - 2017-01-29 18:05 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-30 09:25 -0800
Re: Logic problem, i always had problem translate until statements into while Dr J R Stockton <reply1700@merlyn.demon.co.uk.invalid> - 2017-01-31 23:12 +0000
Re: Logic problem, i always had problem translate until statements into while "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-01 09:22 +0100
Re: Logic problem, i always had problem translate until statements into while Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-27 11:02 +0000
Re: Logic problem, i always had problem translate until statements into while Tim Streater <timstreater@greenbee.net> - 2017-01-27 12:11 +0000
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 07:53 -0800
Re: Logic problem, i always had problem translate until statements into while "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-27 17:07 +0100
Re: Logic problem, i always had problem translate until statements into while Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-28 00:55 +0000
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 18:14 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-27 18:15 -0800
Re: Logic problem, i always had problem translate until statements into while Ben Bacarisse <ben.usenet@bsb.me.uk> - 2017-01-28 15:22 +0000
Re: Logic problem, i always had problem translate until statements into while Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2017-01-28 16:54 +0100
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-28 13:53 -0800
Re: Logic problem, i always had problem translate until statements into while Tim Streater <timstreater@greenbee.net> - 2017-01-28 22:13 +0000
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-29 01:27 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-01-29 09:41 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-02-01 08:51 -0800
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-02-01 09:03 -0800
Re: Logic problem, i always had problem translate until statements into while "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-01 19:19 +0100
Re: Logic problem, i always had problem translate until statements into while Tim Streater <timstreater@greenbee.net> - 2017-02-01 18:35 +0000
Re: Logic problem, i always had problem translate until statements into while "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-02-01 19:40 +0100
Re: Logic problem, i always had problem translate until statements into while Tim Streater <timstreater@greenbee.net> - 2017-02-01 19:06 +0000
Re: Logic problem, i always had problem translate until statements into while Tim Streater <timstreater@greenbee.net> - 2017-02-01 19:09 +0000
Re: Logic problem, i always had problem translate until statements into while jonas.thornvall@gmail.com - 2017-02-01 08:51 -0800
Re: Logic problem, i always had problem translate until statements into while Tim Streater <timstreater@greenbee.net> - 2017-02-01 16:56 +0000
Re: Logic problem, i always had problem translate until statements into while "Evertjan." <exxjxw.hannivoort@inter.nl.net> - 2017-01-27 13:36 +0100
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-27 18:51 -0800 |
| Message-ID | <a5d21c5e-afff-4281-84ad-fca1130e6a42@googlegroups.com> |
| In reply to | #32396 |
Den lördag 28 januari 2017 kl. 03:34:38 UTC+1 skrev jonas.t...@gmail.com: > Den lördag 28 januari 2017 kl. 03:20:47 UTC+1 skrev jonas.t...@gmail.com: > > Den lördag 28 januari 2017 kl. 00:46:20 UTC+1 skrev Gene Wirchenko: > > > On Fri, 27 Jan 2017 10:44:38 -0800 (PST), jonas.thornvall@gmail.com > > > wrote: > > > > > > [snip] > > > > > > >Well i don't think one want express logic from a negated juxta position. > > > > > > You might not want to, but some of us have little problem with > > > it. I have built much nastier expressions. It was what was needed so > > > I got onto it and did it. > > > > > > Sincerely, > > > > > > Gene Wirchenko > > > > Well apparently you read what i say you just don't understand it. I say if you would to build a logic language, you probably wouldn't it all exressed as negations. You may feel proud that you can handle them to a certain level, but if i would to give you a real hard logical problem that you could not read up upon, you probably would damn the fucking language not allow you to express yourself in a clear manner. > > > > Regareding null having no value. > > It is evidently a reserved term telling slots empty > > https://en.wikipedia.org/wiki/Null_pointer > > https://en.wikipedia.org/wiki/Null_(SQL) > > > > It has no value, but the container exist. > > My main point is > > ***THIS IS PREFERABLE*** > > NAIVE CODING regular=? connected=? > > if (regbox checked && conbox checked) > do until (regular true && connected true) > generate(); > > else if (regubox checked && conbox unchecked) > do until (regular true && connected false) > generate(); > > else if (regbox unchecked && conbox checked) > do until (regular false && connected true) > generate(); > > else do until (regular false && connected false) > generate(); > > ***THIS IS CONVOLUTED*** > NAIVE CODING regular=false connected=false found==false > > if (regbox checked && conbox checked) > do until (found==true) > generate(); > if (regular true && connected true) found true; > > else if (regbox checked && conbox unchecked) > do until (found==true) > generate(); > if (regular true && connected false) found true; > > else if (regbox unchecked && conbox checked) > do until (found==true) > generate(); > if (regular false && connected true) found true; > > else do until (found==true) > generate(); > if (regular false && connected false) found true; > > > ================================================= > > I mean aftarall ***what is the logic looking for > while (found==false) or while (found!=true) > > compare to > > do until(found==true) > elegance() ;) > > For none programmers i can say that probably 99,999 would express the later as more clearly expressed, so why do programmers prefer the former "negated statement", is it an occupational injury of the programming environment? > > It would be like trying to trap a bird, and say as long there is no bird in cage i did not trap any, repeatedly. > > While ***normal*** people prefer i do this until i trap a bird "yeah i know they have to check in the box but probably they do check if it is a bird there not if the cage is empty. > > So why do programmers look for the empty cage when they want it full, that is my question. > > ========================================= > I state that the case is to be about anal vanity feeling proud doing it in the most convoluted way possible. Would you like the teachers at kindergarten teaching you Do this excercise until you find() Do this excecise until you not, not_found() It is a no brainer what it should be, now you build an AI i mean what the fuck are you teaching it?
[toc] | [prev] | [next] | [standalone]
| From | John Harris <niam@jghnorth.org.uk.invalid> |
|---|---|
| Date | 2017-01-28 10:07 +0000 |
| Message-ID | <laro8clk55gc18ssib14ke1ja4ml1fvla1@4ax.com> |
| In reply to | #32396 |
On Fri, 27 Jan 2017 18:34:34 -0800 (PST), jonas.thornvall@gmail.com wrote: <snip> >***THIS IS PREFERABLE*** > >NAIVE CODING regular=? connected=? <snip> while (there is more work to do) do next item of work; looks regular and connected. until (there is no more work to do) do next item of work; looks convoluted and unnatural. John
[toc] | [prev] | [next] | [standalone]
| From | Gene Wirchenko <genew@telus.net> |
|---|---|
| Date | 2017-01-30 09:14 -0800 |
| Message-ID | <dusu8cheul4da59ojuorjgcl0vhu3mevvf@4ax.com> |
| In reply to | #32395 |
On Fri, 27 Jan 2017 18:20:43 -0800 (PST), jonas.thornvall@gmail.com
wrote:
[snip]
>Well apparently you read what i say you just don't understand it. I say
No. It is that I do not agree with it.
if you would to build a logic language, you probably wouldn't it all
exressed as negations. You may feel proud that you can handle them to
You presume to tell me what I would think?
Maybe, maybe not. If I needed to do so though, I would get on
with it.
a certain level, but if i would to give you a real hard logical
problem that you could not read up upon, you probably would damn the
fucking language not allow you to express yourself in a clear manner.
Or select another.
It is not being proud; it is doing the job.
[snip]
Sincerely,
Gene Wirchenko
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2017-01-28 10:48 +0100 |
| Message-ID | <XnsA70B6E061AA50eejj99@194.109.6.166> |
| In reply to | #32387 |
Gene Wirchenko <genew@telus.net> wrote on 27 Jan 2017 in comp.lang.javascript: > You do have one thing in common with a lot of us. That is > thinking that your point of view is somehow privileged and therefore > holy. I do not have that to anywhere near the degree that some have, > but I have observed it all too often. I don't consider holyness to be true, so converted to boolean it must be false. Outside the realm of 'booleanitas in sensu strictior', many considerations return tri-state: 'true', 'false', 'don't know [yet?]'. Could/should we, in JS, use 'undefined' for this 'don't know [yet?]'? -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-28 05:05 -0800 |
| Message-ID | <0f9aaf35-e210-4c8c-bd23-91303cead814@googlegroups.com> |
| In reply to | #32402 |
Den lördag 28 januari 2017 kl. 10:49:39 UTC+1 skrev Evertjan.: > Gene Wirchenko <genew@telus.net> wrote on 27 Jan 2017 in > comp.lang.javascript: > > > You do have one thing in common with a lot of us. That is > > thinking that your point of view is somehow privileged and therefore > > holy. I do not have that to anywhere near the degree that some have, > > but I have observed it all too often. > > I don't consider holyness to be true, > so converted to boolean it must be false. > > Outside the realm of 'booleanitas in sensu strictior', > many considerations return tri-state: > > 'true', 'false', 'don't know [yet?]'. > > Could/should we, in JS, use 'undefined' for this 'don't know [yet?]'? > > > > -- > Evertjan. > The Netherlands. > (Please change the x'es to dots in my emailaddress) First sensible answer i read, you make progress Jan-Evert ;)
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2017-01-27 13:43 +0100 |
| Message-ID | <XnsA70A8BA13BE81eejj99@194.109.6.166> |
| In reply to | #32369 |
jonas.thornvall@gmail.com wrote on 27 Jan 2017 in comp.lang.javascript:
> do until(found==true) elegance ;)
comparing a boolean with true is a waste of your intellect.
having an unbalanced ')' is NOT a smiley matter.
and it still is not JS, so use:
while (!found) {};
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Scott Sauyet <scott.sauyet@gmail.com> |
|---|---|
| Date | 2017-01-27 19:52 -0800 |
| Message-ID | <a29c6b35-7afa-4770-a81b-4de30e03c71d@googlegroups.com> |
| In reply to | #32369 |
jonas.thornvall@gmail.com wrote:
> I mean aftarall what is the logic looking for
> while (found==false) or while (found!=true)
>
> compare to
>
> do until(found==true) elegance ;)
>
> For none programmers i can say that probably 99,999 would express
> the later as more clearly expressed, so why do programmers prefer
> the former "negated statement", is it an occupational injury of the
> programming environment?
This is nonsense.
Just as likely is
while (lost) ...
which I presume is better than
do ... until (!lost)
(or repeat ... until` in Pascal)
The substantive difference between `while ...` and `do ... while`
does not have to do with the boolean sense of the test condition.
It has to do only with whether the condition is checked before or
after the body is executed, and hence whether the body is guaranteed
to be run at least once. The sense of the boolean is trivial, and
easily reversed with a `not` operation when necessary.
-- Scott
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-27 22:25 -0800 |
| Message-ID | <c7c5bc19-79ae-40d3-a6b4-615586279006@googlegroups.com> |
| In reply to | #32398 |
Den lördag 28 januari 2017 kl. 04:52:06 UTC+1 skrev Scott Sauyet: > jonas.thornvall@gmail.com wrote: > > > I mean aftarall what is the logic looking for > > while (found==false) or while (found!=true) > > > > compare to > > > > do until(found==true) elegance ;) > > > > For none programmers i can say that probably 99,999 would express > > the later as more clearly expressed, so why do programmers prefer > > the former "negated statement", is it an occupational injury of the > > programming environment? > > This is nonsense. > > Just as likely is > > while (lost) ... > > which I presume is better than > > do ... until (!lost) > > (or repeat ... until` in Pascal) > > The substantive difference between `while ...` and `do ... while` > does not have to do with the boolean sense of the test condition. > It has to do only with whether the condition is checked before or > after the body is executed, and hence whether the body is guaranteed > to be run at least once. The sense of the boolean is trivial, and > easily reversed with a `not` operation when necessary. > > -- Scott My main point is ***THIS IS PREFERABLE*** NAIVE CODING regular=? connected=? if (regbox checked && conbox checked) do until (regular true && connected true) generate(); else if (regubox checked && conbox unchecked) do until (regular true && connected false) generate(); else if (regbox unchecked && conbox checked) do until (regular false && connected true) generate(); else do until (regular false && connected false) generate(); ***THIS IS CONVOLUTED*** NAIVE CODING regular=false connected=false found==false if (regbox checked && conbox checked) do until (found==true) generate(); if (regular true && connected true) found true; else if (regbox checked && conbox unchecked) do until (found==true) generate(); if (regular true && connected false) found true; else if (regbox unchecked && conbox checked) do until (found==true) generate(); if (regular false && connected true) found true; else do until (found==true) generate(); if (regular false && connected false) found true; ================================================= I mean aftarall ***what is the logic looking for while (found==false) or while (found!=true) compare to do until(found==true) elegance() ;) For none programmers i can say that probably 99,999 would express the later as more clearly expressed, so why do programmers prefer the former "negated statement", is it an occupational injury of the programming environment? It would be like trying to trap a bird, and say as long there is no bird in cage i did not trap any, repeatedly. While ***normal*** people prefer i do this until i trap a bird "yeah i know they have to check in the box but probably they do check if it is a bird there not if the cage is empty. So why do programmers look for the empty cage when they want it full, that is my question. ========================================= I state that the case is to be about anal vanity feeling proud doing it in the most convoluted way possible.
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-27 22:36 -0800 |
| Message-ID | <8dfab756-a9cb-438c-aa90-d014a78ac9d3@googlegroups.com> |
| In reply to | #32398 |
Den lördag 28 januari 2017 kl. 04:52:06 UTC+1 skrev Scott Sauyet: > jonas.thornvall@gmail.com wrote: > > > I mean aftarall what is the logic looking for > > while (found==false) or while (found!=true) > > > > compare to > > > > do until(found==true) elegance ;) > > > > For none programmers i can say that probably 99,999 would express > > the later as more clearly expressed, so why do programmers prefer > > the former "negated statement", is it an occupational injury of the > > programming environment? > > This is nonsense. > > Just as likely is > > while (lost) ... > > which I presume is better than > > do ... until (!lost) > > (or repeat ... until` in Pascal) > > The substantive difference between `while ...` and `do ... while` > does not have to do with the boolean sense of the test condition. > It has to do only with whether the condition is checked before or > after the body is executed, and hence whether the body is guaranteed > to be run at least once. The sense of the boolean is trivial, and > easily reversed with a `not` operation when necessary. > > -- Scott Well i know you are pretty smart Scott but in this case you are clearly deranged. What you say is that one can look for not conditions... It is mad, the user set conditions to be fullfilled what does it even mean while lost, and even more deranged do until (!lost) your brain is imperically damaged by your occupation you clearly mean do until (true) your lost is a false i hope you realise that...... or you are really lost. It is a miracle how you manage to communicate with people if you think in negations.
[toc] | [prev] | [next] | [standalone]
| From | Scott Sauyet <scott.sauyet@gmail.com> |
|---|---|
| Date | 2017-01-29 18:05 -0800 |
| Message-ID | <60e017d9-20de-49e4-a975-ab40c5ec87cc@googlegroups.com> |
| In reply to | #32400 |
jonas.thornvall@gmail.com wrote: > skrev Scott Sauyet: >> jonas.thornvall@gmail.com wrote: >> >>> I mean aftarall what is the logic looking for >>> while (found==false) or while (found!=true) >>> >>> compare to >>> >>> do until(found==true) elegance ;) >>> >>> For none programmers i can say that probably 99,999 would express >>> the later as more clearly expressed, so why do programmers prefer >>> the former "negated statement", is it an occupational injury of the >>> programming environment? >> >> This is nonsense. >> >> Just as likely is >> >> while (lost) ... >> >> which I presume is better than >> >> do ... until (!lost) >> >> (or repeat ... until` in Pascal) >> > Well i know you are pretty smart Scott but in this case you are > clearly deranged. I very often have a hard time understanding your posts; I think it's mostly due to communication styles, but perhaps it's a language barrier as well; certainly your inconsiderate posting style plays a part. Because of this, I may have misunderstood what you were saying. It seemed to me that your were suggesting that `do ... until (x)` is appreciably better than `while (x) ...` If that's not what you're saying, then I apologize. If it is, however, then I say again: nonsense. They have two differences. The first (and mostly trivial) one is how the condition is identified. And they can be reversed easily when necessary.. The second one is critical: `do ... until` (in languages that support it) runs the body of the loop at least once, testing the condition after each iteration. `while ...` tests at the beginning of each iteration and may never run the body. That's the important difference. If all you're suggesting is that positively stated conditions are easier to read than their negated inverses, you're right, but it's a fairly trivial and obvious point. And the variables your have handy may make it difficult to choose this path. >> The substantive difference between `while ...` and `do ... while` >> does not have to do with the boolean sense of the test condition. >> It has to do only with whether the condition is checked before or >> after the body is executed, and hence whether the body is guaranteed >> to be run at least once. The sense of the boolean is trivial, and >> easily reversed with a `not` operation when necessary. >> > What you say is that one can look for not conditions... It is mad, > the user set conditions to be fullfilled what does it even mean > while lost, and even more deranged do until (!lost) your brain is > imperically damaged by your occupation you clearly mean do until > (true) your lost is a false i hope you realise that...... or you are > really lost. Who cares what it means? I was just demonstrating that if you have certain variables, object properties, or other data to test that naturally has a particular name, you might well have to negate that name to make a reasonable loop condition. > It is a miracle how you manage to communicate with people if you > think in negations. I will probably go back to ignoring you now, precisely because you don't seem to be able to communicate very well according to the norms of USENET and of comp.lang.javascript. Sorry, I meant "I will probably go back to !(responding to) you..." -- Scott
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-30 09:25 -0800 |
| Message-ID | <8098f1be-ea80-468f-a59f-d1f582a8b8bd@googlegroups.com> |
| In reply to | #32423 |
Den måndag 30 januari 2017 kl. 03:05:15 UTC+1 skrev Scott Sauyet:
> jonas.thornvall@gmail.com wrote:
> > skrev Scott Sauyet:
> >> jonas.thornvall@gmail.com wrote:
> >>
> >>> I mean aftarall what is the logic looking for
> >>> while (found==false) or while (found!=true)
> >>>
> >>> compare to
> >>>
> >>> do until(found==true) elegance ;)
> >>>
> >>> For none programmers i can say that probably 99,999 would express
> >>> the later as more clearly expressed, so why do programmers prefer
> >>> the former "negated statement", is it an occupational injury of the
> >>> programming environment?
> >>
> >> This is nonsense.
> >>
> >> Just as likely is
> >>
> >> while (lost) ...
> >>
> >> which I presume is better than
> >>
> >> do ... until (!lost)
> >>
> >> (or repeat ... until` in Pascal)
> >>
> > Well i know you are pretty smart Scott but in this case you are
> > clearly deranged.
>
> I very often have a hard time understanding your posts; I think it's
> mostly due to communication styles, but perhaps it's a language
> barrier as well; certainly your inconsiderate posting style plays a
> part. Because of this, I may have misunderstood what you were saying.
> It seemed to me that your were suggesting that `do ... until (x)`
No i actually meant exactly what i wrote
do until(condition){}
i did not meant
do{
until(contition)}
is
> appreciably better than `while (x) ...` If that's not what you're
> saying, then I apologize.
>
> If it is, however, then I say again: nonsense. They have two
> differences. The first (and mostly trivial) one is how the condition
> is identified. And they can be reversed easily when necessary..
> The second one is critical: `do ... until` (in languages that support
> it) runs the body of the loop at least once, testing the condition
> after each iteration. `while ...` tests at the beginning of each
> iteration and may never run the body. That's the important difference.
>
> If all you're suggesting is that positively stated conditions are
> easier to read than their negated inverses, you're right, but it's
> a fairly trivial and obvious point. And the variables your have
> handy may make it difficult to choose this path.
>
>
> >> The substantive difference between `while ...` and `do ... while`
> >> does not have to do with the boolean sense of the test condition.
> >> It has to do only with whether the condition is checked before or
> >> after the body is executed, and hence whether the body is guaranteed
> >> to be run at least once. The sense of the boolean is trivial, and
> >> easily reversed with a `not` operation when necessary.
> >>
> > What you say is that one can look for not conditions... It is mad,
> > the user set conditions to be fullfilled what does it even mean
> > while lost, and even more deranged do until (!lost) your brain is
> > imperically damaged by your occupation you clearly mean do until
> > (true) your lost is a false i hope you realise that...... or you are
> > really lost.
>
> Who cares what it means? I was just demonstrating that if you have
> certain variables, object properties, or other data to test that
> naturally has a particular name, you might well have to negate that
> name to make a reasonable loop condition.
>
>
> > It is a miracle how you manage to communicate with people if you
> > think in negations.
>
> I will probably go back to ignoring you now, precisely because you
> don't seem to be able to communicate very well according to the
> norms of USENET and of comp.lang.javascript.
>
> Sorry, I meant "I will probably go back to !(responding to) you..."
>
> -- Scott
[toc] | [prev] | [next] | [standalone]
| From | Dr J R Stockton <reply1700@merlyn.demon.co.uk.invalid> |
|---|---|
| Date | 2017-01-31 23:12 +0000 |
| Message-ID | <bbFvjqvpnRkYFwIF@invalid.uk.co.demon.merlyn.invalid> |
| In reply to | #32423 |
In comp.lang.javascript message <60e017d9-20de-49e4-a975-ab40c5ec87cc@go oglegroups.com>, Sun, 29 Jan 2017 18:05:04, Scott Sauyet <scott.sauyet@gmail.com> posted: >I very often have a hard time understanding your posts; I think it's >mostly due to communication styles, but perhaps it's a language >barrier as well; Assuming that he is linguistically of European background - he should post in his mother tongue followed by what he considers to be an English rendition of the same. Then the educated among us will have two chances at understanding it. And it will annoy the more socially-retarded anglophone monoglots. -- (c) John Stockton, Surrey, UK. ¬@merlyn.demon.co.uk Turnpike v6.05 MIME. Merlyn Web Site < > - FAQish topics, acronyms, & links.
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2017-02-01 09:22 +0100 |
| Message-ID | <XnsA70F5F4EC7F6Beejj99@194.109.6.166> |
| In reply to | #32431 |
Dr J R Stockton <reply1700@merlyn.demon.co.uk.invalid> wrote on 01 Feb 2017 in comp.lang.javascript: > And it will annoy the more socially-retarded anglophone monoglots. Quite. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2017-01-27 11:02 +0000 |
| Message-ID | <87k29gzrxo.fsf@bsb.me.uk> |
| In reply to | #32366 |
jonas.thornvall@gmail.com writes: > Den fredag 27 januari 2017 kl. 00:06:24 UTC+1 skrev Ben Bacarisse: >> jonas.thornvall@gmail.com writes: >> >> > Den torsdag 26 januari 2017 kl. 22:24:32 UTC+1 skrev jonas.t...@gmail.com: >> >> Den torsdag 26 januari 2017 kl. 21:29:05 UTC+1 skrev Ben Bacarisse: >> >> > jonas.thornvall@gmail.com writes: >> >> > >> >> > > do until (regular == true && connected == false ) >> >> > > >> >> > > I honestly feel a bit lost, because i think they are so easy to code >> >> > > using do until. >> >> > >> >> > What as the initial values of 'regular' and 'connected'? >> >> > >> >> > > So how should i think about it? >> >> > >> >> > Provided the initial value of the resulting while condition is true you >> >> > just need to invert it: >> >> > >> >> > while (!(regular == true && connected == false)) ... >> >> > >> >> > You can use De Morgan's laws to simplify that if you like: >> >> > >> >> > !(A && B) <=> !A || !B >> >> > !(A || B) <=> !A && !B >> >> > >> >> > in your case >> >> > >> >> > !(regular == true && connected == false) >> >> > => !(regular == true) || !(connected == false) >> >> > => regular != true || connected != false >> >> > >> >> > which I'd just write as >> >> > >> >> > while (!regular || connected) ... >> >> > >> >> > Often, the use of do ... until is simply an error (while is needed more >> >> > often in algorithms than do...until). In those cases there is no need >> >> > for the loop to execute at least once and you don't need to check that >> >> > '!regular || connected' is initially true. >> >> > >> >> > -- >> >> > Ben. >> >> >> >> Unfortunately they are both false, >> >> Why is that unfortunate? If they are both initially false your >> do...until can be written as a while with the condition negated. >> >> <snip> >> -- >> Ben. > > I feel you dodged the obstacle, Probably. > i asked if the boolean is > generated/searched and found within loop and all values of the truth > table can be found, how do you set the start condition, can i set the > boolean to "null" at start? If you asked this I missed it, but I couldn't answer it anyway because I don't know what it means. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | Tim Streater <timstreater@greenbee.net> |
|---|---|
| Date | 2017-01-27 12:11 +0000 |
| Message-ID | <270120171211569733%timstreater@greenbee.net> |
| In reply to | #32372 |
In article <87k29gzrxo.fsf@bsb.me.uk>, Ben Bacarisse <ben.usenet@bsb.me.uk> wrote: >jonas.thornvall@gmail.com writes: >>> >> > What as the initial values of 'regular' and 'connected'? >> i asked if the boolean is >> generated/searched and found within loop and all values of the truth >> table can be found, how do you set the start condition, can i set the >> boolean to "null" at start? > >If you asked this I missed it, but I couldn't answer it anyway because I >don't know what it means. He should just set them to true or false initially as appropriate. -- "The problem with defending the purity of the English language is that English is about as pure as a cribhouse whore. We don't just borrow words; on occasion, English has pursued other languages down alleyways to beat them unconscious and rifle their pockets for new vocabulary." -- James Nicoll, rasfw
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-27 07:53 -0800 |
| Message-ID | <2c773886-ea14-44a9-9ee4-326769db8be7@googlegroups.com> |
| In reply to | #32372 |
Den fredag 27 januari 2017 kl. 12:02:48 UTC+1 skrev Ben Bacarisse: > jonas.thornvall@gmail.com writes: > > > Den fredag 27 januari 2017 kl. 00:06:24 UTC+1 skrev Ben Bacarisse: > >> jonas.thornvall@gmail.com writes: > >> > >> > Den torsdag 26 januari 2017 kl. 22:24:32 UTC+1 skrev jonas.t...@gmail.com: > >> >> Den torsdag 26 januari 2017 kl. 21:29:05 UTC+1 skrev Ben Bacarisse: > >> >> > jonas.thornvall@gmail.com writes: > >> >> > > >> >> > > do until (regular == true && connected == false ) > >> >> > > > >> >> > > I honestly feel a bit lost, because i think they are so easy to code > >> >> > > using do until. > >> >> > > >> >> > What as the initial values of 'regular' and 'connected'? > >> >> > > >> >> > > So how should i think about it? > >> >> > > >> >> > Provided the initial value of the resulting while condition is true you > >> >> > just need to invert it: > >> >> > > >> >> > while (!(regular == true && connected == false)) ... > >> >> > > >> >> > You can use De Morgan's laws to simplify that if you like: > >> >> > > >> >> > !(A && B) <=> !A || !B > >> >> > !(A || B) <=> !A && !B > >> >> > > >> >> > in your case > >> >> > > >> >> > !(regular == true && connected == false) > >> >> > => !(regular == true) || !(connected == false) > >> >> > => regular != true || connected != false > >> >> > > >> >> > which I'd just write as > >> >> > > >> >> > while (!regular || connected) ... > >> >> > > >> >> > Often, the use of do ... until is simply an error (while is needed more > >> >> > often in algorithms than do...until). In those cases there is no need > >> >> > for the loop to execute at least once and you don't need to check that > >> >> > '!regular || connected' is initially true. > >> >> > > >> >> > -- > >> >> > Ben. > >> >> > >> >> Unfortunately they are both false, > >> > >> Why is that unfortunate? If they are both initially false your > >> do...until can be written as a while with the condition negated. > >> > >> <snip> > >> -- > >> Ben. > > > > I feel you dodged the obstacle, > > Probably. > > > i asked if the boolean is > > generated/searched and found within loop and all values of the truth > > table can be found, how do you set the start condition, can i set the > > boolean to "null" at start? > > If you asked this I missed it, but I couldn't answer it anyway because I > don't know what it means. > > -- > Ben. Well the little i know Ben is that null have *no value* yet is defined "not undefined".
[toc] | [prev] | [next] | [standalone]
| From | "Evertjan." <exxjxw.hannivoort@inter.nl.net> |
|---|---|
| Date | 2017-01-27 17:07 +0100 |
| Message-ID | <XnsA70AAE412B670eejj99@194.109.6.166> |
| In reply to | #32383 |
jonas.thornvall@gmail.com wrote on 27 Jan 2017 in comp.lang.javascript: > Well the little i know Ben Perhaps you are mistaken? > is that null have *no value*, "has" > yet is defined "not undefined". null IS a defined value, the null-value! Values CANNOT be undefined. But we are talking about the 'content of a variable', which can SET, HOLD and RETURN the 'undefined' value. If an 'undefined' variable HAS a value, and if 'undefined' variable IS a value, is just, imho, a Q of semantics. A non-declared or a deleted variable can certainly be said to have the value 'undefined'. If you semantically want to CALL that value a non-value, be my guest, in JS it does not matter. -- Evertjan. The Netherlands. (Please change the x'es to dots in my emailaddress)
[toc] | [prev] | [next] | [standalone]
| From | Ben Bacarisse <ben.usenet@bsb.me.uk> |
|---|---|
| Date | 2017-01-28 00:55 +0000 |
| Message-ID | <87a8acvw9e.fsf@bsb.me.uk> |
| In reply to | #32383 |
jonas.thornvall@gmail.com writes: <snip> > Well the little i know Ben is that null have *no value* yet is defined > "not undefined". I've cut the rest because I don't see any connection with what went before (but I accept I understand only about 1/4 of your posts). null is the sole value of the type named Null. I can't see why you say is has "no value" -- it *is* a value. But you are right that it is defined. -- Ben.
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-27 18:14 -0800 |
| Message-ID | <1c7dff50-15a7-4727-99ee-5bfbfec58d3c@googlegroups.com> |
| In reply to | #32392 |
Den lördag 28 januari 2017 kl. 01:55:14 UTC+1 skrev Ben Bacarisse: > jonas.thornvall@gmail.com writes: > <snip> > > Well the little i know Ben is that null have *no value* yet is defined > > "not undefined". > > I've cut the rest because I don't see any connection with what went > before (but I accept I understand only about 1/4 of your posts). > > null is the sole value of the type named Null. I can't see why you say > is has "no value" -- it *is* a value. But you are right that it is > defined. > > -- > Ben. https://en.wikipedia.org/wiki/Null_(SQL)
[toc] | [prev] | [next] | [standalone]
| From | jonas.thornvall@gmail.com |
|---|---|
| Date | 2017-01-27 18:15 -0800 |
| Message-ID | <147627b2-8230-403c-92a5-fad29f9585db@googlegroups.com> |
| In reply to | #32392 |
Den lördag 28 januari 2017 kl. 01:55:14 UTC+1 skrev Ben Bacarisse: > jonas.thornvall@gmail.com writes: > <snip> > > Well the little i know Ben is that null have *no value* yet is defined > > "not undefined". > > I've cut the rest because I don't see any connection with what went > before (but I accept I understand only about 1/4 of your posts). > > null is the sole value of the type named Null. I can't see why you say > is has "no value" -- it *is* a value. But you are right that it is > defined. > > -- > Ben. https://en.wikipedia.org/wiki/Null_pointer
[toc] | [prev] | [next] | [standalone]
Page 2 of 3 — ← Prev page 1 [2] 3 Next page →
Back to top | Article view | comp.lang.javascript
csiph-web