Operator outta lazarus / 21-General ---------------------------------------------------------------------- domasz · 2024-08-01 07:33 So we have operator in. We can use it like: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if 5 in [1,3,5] Then we should have outta, like: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if 5 outta [1,3,4] Much cleaner than Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if not (5 in [1,3,4]) ---------------------------------------------------------------------- 440bx · 2024-08-01 08:05 if something like that were to be considered, I'd much prefer something along the lines of:Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if 5 notin [1, 3, 4] then { whatever } ; ---------------------------------------------------------------------- domasz · 2024-08-01 08:17 That's even better. We need this feature now! It's impossible to write any program in FP without this feature!!11 ---------------------------------------------------------------------- BildatBoffin · 2024-08-01 09:39 Why not just the not-in combo Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if 5 not in [1,3,4] ---------------------------------------------------------------------- Kays · 2024-08-01 09:46 IfCode: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if notbothers you, you may want to program in Ruby or other languages that have the keywordCode: Ruby  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i unlessThere is of course the option to rephrase an expression:Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if [5] * [1, 2, 3] = [] then ---------------------------------------------------------------------- domasz · 2024-08-01 10:02 "not in" might be harder to introduce than "notin" since "not" already is used for something else. For me "unless" is kinda weird. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if [5] * [1, 2, 3] = [] thenThat's too mathy ---------------------------------------------------------------------- wp · 2024-08-01 11:11 What's wrong with Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i  if not (5 in [1, 2, 3])? Having to type two backets? Come on... ---------------------------------------------------------------------- domasz · 2024-08-01 11:19 Brackets make things harder to read. In this example it's easy: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if not (5 in [1, 2, 3])but it can be more complicated: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i if ((not (5 in [1,2,3]) or (6 > 5) or (7 = fun(8))) and (1 = 2)With operator "notin" and a few others we could simplify a lot or expressions. ---------------------------------------------------------------------- H₂SO₄ · 2024-08-01 11:23 If you really, really want to do this... Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {$macro on}{$define outta := xor} type  TByteSet = set of Byte; operator xor(A: Integer; B: TByteSet): Boolean; inline;begin  Result := not (A in B);end; function Test(): Boolean;begin  Result := 5 outta [1, 3, 4];end; ---------------------------------------------------------------------- domasz · 2024-08-01 20:38 Thanks, Khrys. That's very nice!