Changes

Jump to navigation Jump to search
780 bytes added ,  16:50, 10 June 2024
Line 6: Line 6:     
  ! can be used to (1) Compute factorial of numbers (including complex numbers etc), (2) Create functions out of strings, (3) Create predicate functions and search functions out of simple notations with regular expressions, strings, etc.
 
  ! can be used to (1) Compute factorial of numbers (including complex numbers etc), (2) Create functions out of strings, (3) Create predicate functions and search functions out of simple notations with regular expressions, strings, etc.
 +
 +
<pre>
 +
 +
"x^2"!
 +
("x^2"!)(3)
 +
// could make ! binary with similar behavior too.
 +
1..100.$("x^2"!)
 +
1..100.$("SIN(x)"!)
 +
("SIN(x)"!)(3,4)
 +
 +
s="x^5";
 +
g=(s!);
 +
g(34);
 +
 +
s="x^5+y^4";
 +
g=(s!);
 +
g(1,3);
 +
 +
("x^5+y^4+z^5"!)(2,3,4);
 +
 +
MS(12).$$("SUM(x)"!)
 +
MS(1..12).$$("SUM(x)"!)
 +
 +
a="x^4";
 +
foured=(a!)#;
 +
foured(1..34)
 +
 +
(["x^3","x^4"]!)@1..3
 +
 +
// did not work
 +
("x^"|.+|1..10)!@(1..10)
 +
//this did not parse
 +
("x^"|x+y|1..10)!@1..10
 +
// also did not parse
 +
("x+"|x+y|1..10)!@1..10
 +
 +
"<1"!
 +
// this gives "" on fixchars
 +
("x<3"!)(2)
 +
("x<3&&y>4"!)(2,5)
 +
"<'absc'"!
 +
"<=3"!
 +
">=3"!
 +
"!=3"!
 +
("x<3&&x>4"!)+""
 +
("SIN(x)"!)(35deg)
 +
"==(44)"!
 +
"==(44!)"!
 +
 +
f1="FEQ(44!,x)"!;
 +
f1(43!)
 +
 +
..5@((1..10|.+|"x")!)
 +
..50@((1..10|.+|"x^")!)
 +
1..100.F(">50"!)
 +
1..100.F("x>5&&x<25"!)
 +
 +
</pre>
2,824

edits

Navigation menu