Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.javascript > #37759
| From | Arno Welzel <usenet@arnowelzel.de> |
|---|---|
| Newsgroups | comp.lang.javascript |
| Subject | Re: Comparisson with a list arguments. |
| Date | 2019-11-12 15:23 +0100 |
| Message-ID | <h2vtjcFr2hfU1@mid.individual.net> (permalink) |
| References | (1 earlier) <957d259a-72c6-4858-af44-8f0cc06c9b7c@googlegroups.com> <1e310742-4ab9-45d4-9504-b9e61ec92a05@googlegroups.com> <2477dad4-800e-49e8-b0e7-67733fad2467@googlegroups.com> <cc9bda7a-9187-47fd-ac70-f5b18dd5a0e2@googlegroups.com> <d5a81bca-3d60-4f08-8950-afc1aa38e15e@googlegroups.com> |
On 08.11.19 10:30, Jonas Thörnvall wrote:
[...]
> But is not the idea to make things as easy as possible, not as
> obfuscated and convoluted as possible? I mean it is a scripting
Look at this:
a = floor(b-z);
if (a inside(x-y)) {
dosomething();
}
This *is* "obfuscated and convulated as possible".
1) Why is "x-y" not the *expression* of "x minus y" as it was a line
before where "b-z" means "b minus z"? This is completely illogical.
2) Does "inside (x-y)" mean "more than x and less than y" (>x && <y) or
"the same or more than x and the same or less than y" (>=x && <=y)?
There is no universal definition which says, that a number is only
inside an interval if it is more than the lower limit and less then the
upper limit.
But an expression like "a>x && b<y" is clear - a has to be more than x
and less then y where "a>=x && b<=y" includes the lower and upper limit.
3) What if x or y are not scalar values but expressions?
Let's say x is calculated as "p-t":
if (a inside(p-t-y)) {
dosomething();
}
Well - of course this makes no sense. So you need to define a rule, that
expressions are either not allowed here or the have to be in paranthesis:
if (a inside((p-t)-y)) {
dosomething();
}
But again: why is "p-t" an expresion "p minus t" and "(p-t)-y" means
"from p minus t to y"? This is also quite confusing.
If you go on like this, you may end up with a kind of natural language
parser and not a programming language.
And what exactly is your problem with "if (a>x && a<y)" ? The meaning is
completely clear.
> language we are not into blip-blopping we try to raise the context so
> the syntax can mirror a somewhat working semantic. Or are we
> protecting our jobs, i just want to know what is going on and why?
>
> This is a script language, made to be available as a learning
> language, where principles are elevated to reflect human thinking? So
> ideas that can be presented clear in language should also be possible
> to implement, or are we trying to create a lingo to cringe books and
> seminars?
JavaScript is *not* intended as "learning language". It is just a
scripting language, nothing else.
Either you take it it as it is or you create your own language where you
can implement all the things you want to have. Maybe this would be a
good exercise for you so you realize what it means to interpret source
code in a way that the computer knows what to do.
At least you should not suggest "-" for the interval parameter, so it
would be:
if (a inside(x,y))
But then you can also just create your own class for "a" which provides
an method inside():
if (a.inside(x,y))
--
Arno Welzel
https://arnowelzel.de
Back to comp.lang.javascript | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
Comparisson with a list arguments. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-08 00:07 -0800
Re: Comparisson with a list arguments. Julio Di Egidio <julio@diegidio.name> - 2019-11-08 00:17 -0800
Re: Comparisson with a list arguments. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-08 01:03 -0800
Re: Comparisson with a list arguments. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-08 01:08 -0800
Re: Comparisson with a list arguments. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-08 01:19 -0800
Re: Comparisson with a list arguments. Arno Welzel <usenet@arnowelzel.de> - 2019-11-12 12:17 +0100
Re: Comparisson with a list arguments. Julio Di Egidio <julio@diegidio.name> - 2019-11-08 01:13 -0800
Re: Comparisson with a list arguments. Julio Di Egidio <julio@diegidio.name> - 2019-11-08 01:23 -0800
Re: Comparisson with a list arguments. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-08 01:30 -0800
Re: Comparisson with a list arguments. Julio Di Egidio <julio@diegidio.name> - 2019-11-08 02:19 -0800
Re: Comparisson with a list arguments. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-08 02:33 -0800
Re: Comparisson with a list arguments. Arno Welzel <usenet@arnowelzel.de> - 2019-11-12 15:25 +0100
Re: Comparisson with a list arguments. Julio Di Egidio <julio@diegidio.name> - 2019-11-12 06:48 -0800
Re: Comparisson with a list arguments. Arno Welzel <usenet@arnowelzel.de> - 2019-11-12 18:41 +0100
Re: Comparisson with a list arguments. Julio Di Egidio <julio@diegidio.name> - 2019-11-12 09:50 -0800
Re: Comparisson with a list arguments. Arno Welzel <usenet@arnowelzel.de> - 2019-11-12 18:55 +0100
Re: Comparisson with a list arguments. John G Harris <niam@jghnorth.org.uk.invalid> - 2019-11-08 11:33 +0000
Re: Comparisson with a list arguments. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-08 06:53 -0800
Re: Comparisson with a list arguments. John G Harris <niam@jghnorth.org.uk.invalid> - 2019-11-08 19:31 +0000
Re: Comparisson with a list arguments. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-08 11:38 -0800
Re: Comparisson with a list arguments. Arno Welzel <usenet@arnowelzel.de> - 2019-11-12 15:26 +0100
Re: Comparisson with a list arguments. Arno Welzel <usenet@arnowelzel.de> - 2019-11-12 15:23 +0100
Re: Comparisson with a list arguments. Jonas Thörnvall <jonas.thornvall@gmail.com> - 2019-11-11 01:31 -0800
Re: Comparisson with a list arguments. Arno Welzel <usenet@arnowelzel.de> - 2019-11-12 12:16 +0100
Re: Comparisson with a list arguments. luserdroog <luser.droog@gmail.com> - 2019-11-08 08:35 -0800
Re: Comparisson with a list arguments. Arno Welzel <usenet@arnowelzel.de> - 2019-11-12 12:13 +0100
Re: Comparisson with a list arguments. Julio Di Egidio <julio@diegidio.name> - 2019-11-12 06:39 -0800
Re: Comparisson with a list arguments. Arno Welzel <usenet@arnowelzel.de> - 2019-11-12 18:52 +0100
Re: Comparisson with a list arguments. Julio Di Egidio <julio@diegidio.name> - 2019-11-12 10:08 -0800
Re: Comparisson with a list arguments. Arno Welzel <usenet@arnowelzel.de> - 2019-11-14 08:11 +0100
csiph-web