« first day (691 days earlier)      last day (1950 days later) » 

8:58 AM
@dzaima I often find that ⍣¯1 is awkward to use for a simple inverse, as it may require separation, and is quite verbose. What do you think of allowing a new syntax ¯f to mean f⍣¯1. I'm not sure about the scope. E.g. Should ¯f g be (f g)⍣¯1 or (f⍣¯1)g? Should ¯f¨ be (f¨)⍣¯1 or (f⍣¯1)¨? Should ¯f∘g be f⍣¯1∘g or f∘g⍣¯1?
I'm inclined to think that it should have short scope, just like ¯1 2 means (-1) 2.
 
9:49 AM
@Adám yeah, that'd make sense
though with that case, it's no different from a monadic op except by the placing of the character
 
@dzaima True. Ideally, I'd want normal monadic operator, but I can't think of any sensible one, and this syntax seems more natural.
 
hmm having ¯(4) 5 give [-4, 5] would be interesting
 
Oh, syntactic ambiguity? ¯3∘f
Except of course if ¯ has short scope anyway.
 
it would make sense for ¯ to eat a single token on its right, but that have many consequences, e.g. my example & ¯ 4
 
@dzaima Yeah. And I don't like adding more syntactic rules.
 
9:56 AM
¯ for function inverting already is a strange new syntax
 
@dzaima I know.
Maybe better: f⸚ is f⍣¯1
@dzaima The benefit of that special syntax is that it may be used inline with no parens. E.g. f∘¯g∘h is f∘(g⍣¯1)∘h whereas f∘g⸚∘h would be (f∘g)⍣¯1∘h and you'd need to write f∘(g⸚)∘h.
It is also immediately obvious and readable, imho.
 
@Adám oh so there is a difference.
 
@dzaima Hm, it doesn't have to be regarded as such. ¯ could be a valid identifier character (indeed, it is regarded like a digit for names in APLX). We could just imagine that for every (invertible) function you define (and also for invertible built-ins), you automatically cause a companion function to be define which is the inverse, and is named ¯name.
 
imo allowing ¯name and ¯(fa fb) though is a bit strange as ¯(4-5) isn't
 
@dzaima I didn't propose allowing ¯(f g)
No more writing ⊥⍣¯1⊢ or (⊥⍣¯1); just use ¯⊥
 
10:06 AM
@Adám that doesn't follow the name logic though
 
@dzaima Why not? You can see ¯ as a prefix akin to J's postfix . and :.
 
@Adám isn't a name
 
@dzaima Sure it is, it just doesn't need spaces to separate it from adjacent tokens.
 
also what about a name ¯a¯b¯yay
 
@dzaima Though that's (almost) allowed in APLX, I'm not proposing allowing the user to use ¯ in names. Just like is a valid-in-names character that the user may not use.
 
10:11 AM
@Adám oh that makes me realize/remember that is very strange
 
@dzaima It is really only the sole that's strange. Otherwise it is just another letter, albeit restricted use.
 
yeah, with that in mind, ¯f makes sense
 
@dzaima Hm, what's the right regex for transforming ¯name to (name⍣¯1) and ¯⊥ to (⊥⍣¯1) while preserving ¯123…?
 
@Adám ¯(?=[^0-9])(\w+) maybe? can't test on phone though :|
 
@dzaima Well, at least it needs (?=[^.0-9])(\w+) to leave ¯.5 alone. Hang on, I'll test.
 
10:17 AM
right
also what about ¯op? just leave as error?
 
@dzaima Oh, and \w needs to be . to catch primitives.
@dzaima Yes, at least for now. I can't think of an operator which has an inverse that isn't just the inverse of the derived function.
@dzaima I think '¯(?=[^0-9])(\w+|.)'⎕R'(\1⍣¯1)' does it, but '¯[\d.]' '¯(\w+|.)'⎕R'&' '(\1⍣¯1)' may be easier to read.
 
@dzaima [^0-9] can be golfed to \D
 
@H.PWiz In this case, yes, but we need period there too.
 
@H.PWiz i'm scared of superscripts appearing somewhere :p
 
@dzaima They are not captured by default, and they would be syntax errors anyway.
 
 
2 hours later…
12:50 PM
Anyone got a good solution for this challenge. I think mine looks ugly, but I can't think of anything better
 
1:37 PM
Attending talk "Does #APL need a type system" by Aaron Hsu at #FnConf18 - what are types, why need them. Having (mostly) been a #Java dude this conf is mind-bending and a bit overwhelming. But finally diving deep into #compscience topics that I've always wondered about
Here's a snippet of the workshop conducted by Aaron W Hsu, @mkromberg and @softwareartisan: 4 minutes to an animated vedic square - a demo of the power of APL! #FnConf18 https://t.co/G7Q0TmTi80
 
 
5 hours later…
ngn
6:07 PM
@H.PWiz i don't have a better solution but i found a way to save a byte: (⊃⍳∘≢,.(,/)⊂)¨ -> (,∘↑⍳∘≢,/¨⊂)¨
this generates blank strings (only spaces) among the words' substrings but they do not affect the solution
 
Nice, that at least removes some ugliness
 

« first day (691 days earlier)      last day (1950 days later) »