Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Arno Welzel Newsgroups: comp.lang.javascript Subject: Re: Comparisson with a list arguments. Date: Tue, 12 Nov 2019 15:23:39 +0100 Lines: 85 Message-ID: References: <957d259a-72c6-4858-af44-8f0cc06c9b7c@googlegroups.com> <1e310742-4ab9-45d4-9504-b9e61ec92a05@googlegroups.com> <2477dad4-800e-49e8-b0e7-67733fad2467@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: individual.net t2llLT0VxRDmYUmxaDocCA4yysIgODv7vSDTM5BjgBZfsW5cv6 Cancel-Lock: sha1:oh13fGdqEZ9YjiXS/phJcit5yOo= In-Reply-To: Content-Language: en-US Xref: csiph.com comp.lang.javascript:37759 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 && =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=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 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