« first day (814 days earlier)      last day (1824 days later) » 

3:58 AM
@voidhawk See thorough treatment of the subject from this message until the end of the following day.
@voidhawk In short, it would be an unnecessary abstraction with terrible consequences for performance.
@voidhawk Monadic is currently {(,~~⍵)/,⍳⍴⍵} but we're considering changing it to {(,⍵)/,⍳⍴⍵} so it isn't thats simple. Also, it has no performance cost, and isn't an abstraction, but rather a well-defined unit of thought.
 
 
6 hours later…
ngn
9:40 AM
@voidhawk imho filter is common enough to deserve its own syntax
 
Ven
We talked about it a few days ago
 
@ngn It does: / (or really)
 
ngn
@Adám it's not the same, you have to mention the argument twice
 
10:08 AM
@ngn No, there are two arguments which may or may not be the same. Filter A by B. There could be a filter operator F←{⍵/⍨⍺⍺ ⍺} which you could use with "selfie" as in (2∘|)F⍨A just like "" in J, which is defined as {⍺←⍳≢⍵ ⋄ ⍺⌷⍨⊂⍋⍵}. But it just makes for awkward syntax if you want ⍺⍺ called dyadically.
 
ngn
@Adám when i use the term "filter", i mean it as in functional programming - one list, one filtering function, applied monadicly
 
@ngn Right, that's an unnecessarily restricted instance of a general concept. We don't need a summation function when we have the more general reduction.
 
ngn
@Adám "unnecessary abstraction" is a matter of opinion. with phrases like "tool of thought" and "unnecessary abstraction" you can justify anything you like and discredit anything you don't like. aren't +.× and unnecessary abstractions over + and ×?
and i don't understand the performance argument. filter would be each-y and slower, of course. / and would still be there for the cases when the filtering function can be applied to whole vectors
 
 
1 hour later…
Ven
11:41 AM
Certainly, ⍋ and / are mirror in their "philosophy", though if ⍋ returned the sorted array, getting the same result as we currently do wouldn't be too hard :)
 
12:00 PM
@Ven What do you mean by the same result as we currently do?
 
Ven
@Adám let ⍋' be the current ⍋ operator, and ⍋ be {⍵[⍋⍵]}. Deriving ⍋' from isn't too hard
Wow, the difference in font rendering between ⍋ and on firefox...
 
12:21 PM
@Ven Right, but that wasn't the point, rather B[⍋A] ≡ B⍋A and thus A[⍋A] ≡ ⍋⍨A while ⍋A retains its current meaning. So just like the dyadic form sorts the left argument by the grade of the right argument, so too Filter (say ƒ) could filter the left argument by the mask of the right argument, i.e. (B/⍨g A) ≡ Bƒg A but why have such an operator when you can have the more general / and just write B/⍨g A ?
 
Ven
@Adám My only point was that... and / are mirror in their "philosophy" :).
(and that, like we discussed earlier this week, things would be much better if not for /'s confused self)
 
12:37 PM
@Ven Yeah. Also, I think I use /⍨ more than /. Maybe there would be room for a function defined as {⍵⌿⍺} "filter by". Then you could write B ƒ g A or tacitly ƒ∘g and "filter self" would be ƒ∘g⍨
 
Ven
@Adám You use it so often that you'd see {⍵⌿⍺} in that order?
 
@Ven Yes. My father called it where, e.g. names where 50<+/sales
 
Ven
I'd like Roger Hui's where first :P
 
@Ven What is it?
 
Ven
@Adám a where a←1?
 
12:50 PM
@Ven What? ...a=1?
 
Ven
Yes, haskell-style where
 
ngn
@Ven John Scholes used to advocate this syntax
 
Ven
Er, I probably mixed John Scholes and Roger Hui then...
 
ngn
it could be implemented as where←⊣ :)
 
Ven
Sorry.
 
1:01 PM
@Ven How is that not where←⌿⍨ ?
 
Ven
@Adám do you mean filter? :)
 
@Ven deriving from ⍋' is way easier though (and much more simple & fast). the philosophy of both and / is to allow separation of the "settings" and the array the settings are are applied to.
 
ngn
@Adám that's a different meaning of "where". in haskell you can write something like expr where name1=expr1, name2=expr2. "where" simply introduces name-value bindings for the expression, nothing to do with "filter"
 
Mar 5 at 11:07, by Adám
avg←sum÷num;
    sum←+⌿;
    num←≢
 
Ah, sorry. Yes,
 
Ven
1:08 PM
@dzaima Oh, defnitely.
 
ngn
1:26 PM
@Ven hey, that could be a complete program instead of a dfn. 49 bytes: ⊃x⌽⍨⊃i-4×2-⌊1.8⊥⍋1↓i←⎕⍳⍨x←,⍉'CDHS'∘.,2↓⎕D,'TJQKA'
 
Ven
1:43 PM
Ah, that's pretty nifty
 
 
4 hours later…
6:10 PM
That seems a little long
 
 
3 hours later…
9:04 PM
@Adám thanks, that discussion makes sense from a performance standpoint. I just frequently find myself doing something like temp/⍨5<temp←⍳10 , whereas it would be nice to do something like F←{⍵/⍨⍺⍺⍵}⋄5∘<F⍳10 . But I haven't done any serious thinking around making it sufficiently general (performance characteristics/APL philosophy adherence aside)
 

« first day (814 days earlier)      last day (1824 days later) »