It was silly to have an operator that immediately called its operand on
its argument and did nothing else with the operand. Better to have a
function that takes the output of the operand as its left argument.
That avoids the confusion I had over whether the operator should take a
function that acts on a single element or on the whole list: it now
takes neither.
This doesn't even make calling the function any harder. It just changes
F _split x into F⊸Split x.
-_split←{
- delims←𝔽𝕩
- blocknums ← +`delims
- # Set entries in blocknums to -1 when they correspond with delims.
- blocknums ↩ (¯1¨)⌾(delims⊸/) blocknums
+Split←{
+ blocknums ← +`𝕨
+ # Set entries in blocknums to -1 when they correspond with delimiters.
+ blocknums ↩ (¯1¨)⌾(𝕨⊸/) blocknums
blocknums⊔𝕩
}
-Prep←{⍉>•ParseFloat¨¨{𝕩∊",-"}_split¨𝕩}
+Prep←{⍉>•ParseFloat¨¨{𝕩∊",-"}⊸Split¨𝕩}
Main←{𝕊[x0,x1,y0,y1]:
+´((x0≤y0)∧(x1≥y1))∨((y0≤x0)∧(y1≥x1))
-_split←{
- delims←𝔽𝕩
- blocknums ← +`delims
- # Set entries in blocknums to -1 when they correspond with delims.
- blocknums ↩ (¯1¨)⌾(delims⊸/) blocknums
+Split←{
+ blocknums ← +`𝕨
+ # Set entries in blocknums to -1 when they correspond with delimiters.
+ blocknums ↩ (¯1¨)⌾(𝕨⊸/) blocknums
blocknums⊔𝕩
}
-Prep←{⍉>•ParseFloat¨¨{𝕩∊",-"}_split¨𝕩}
+Prep←{⍉>•ParseFloat¨¨{𝕩∊",-"}⊸Split¨𝕩}
Main←{𝕊[x0,x1,y0,y1]:
+´((x0≤y1)∧(x1≥y0))∨((y0≤x1)∧(y1≥x0))