« first day (897 days earlier)      last day (1774 days later) » 

12:51 PM
Hey @Adám, correct me if I'm wrong, but isn't this challenge basically dyadic ?
 
@J.Sallé I'll have a look. (90% of application code is and )
 
There are some constraints, but I think it's basically
 
@J.Sallé Well, it is with (and you need to take care of the incomparables and the fallback value).
 
Yeah, that's what I thought. I'll give it a shot later today if no one does before that
 
I have 13 in Extended so far.
 
1:03 PM
I need to get back to the APL mindset. I spent the day yesterday making a RESTful Golang api for a job interview
I'm still seeing type X struct{...} whenever I think of an object
 
 
5 hours later…
5:41 PM
@Adám It's easy to get this n@{(x∊i)∨~x∊t}t⍳x but I can't seem to make a train out of the operand to @. It seems like there should be on hiding in there.
 
6:05 PM
@Adám How does ⌷ help?
 
6:34 PM
@PaulMansour Well, the operand is "niladic" (it ignores its argument), so it'll be a bit odd: ((x∊i∘⊢)≥x∊t∘⊢) or (⊃(≥/x∘∊¨i t∘⊢)) If we get one or more constant operators it'll be slightly neater.
 
:50992747 It could be monadic: n@{(x∊i)∨⍵=≢t}t⍳x
But regardless, trains are not going to make it any shorter, correct?
Too many variables
 
@PaulMansour Well, you need to index, so it is or or []. Can we please have ?
 
@Adám Maybe I misread the challenge. The result are indices, not indexed values. What am I missing. Does my solution not work?
 
@PaulMansour Yeah.
@PaulMansour Oh, I misread. I thought we actually had to return the value. Odd that the result is a mixture of indices and default values. I automatically assumed that the result would be consistent (only values, from the table or the fallback).
@PaulMansour I've got 21 bytes. You?
 
6:50 PM
@Adám I posted it. That's what we are discussing.
 
@PaulMansour Can you link me?
 
@Adám n@{(x∊i)∨~x∊t}t⍳x
 
@PaulMansour Oh, I thought you posted to the challenge page. :-)
 
I did not post on stack exchange. Just here.
 
@PaulMansour (the site it now called codegolf.SE or CG&CC)
 
6:52 PM
@Adám that's why I asked about it being very similar to . Seems like the default behaviour for , but instead of returning 1+≢⍵, it returns a fallback value when some item is not found.
 
@J.Sallé Except you have to account for the incomparables.
 
@Adám yeah there's that too. I didn't actually understand the whole incomparable business. I'll read the challenge again.
Oh nevermind ^
The incomparables are just a list as well
 
@PaulMansour Ah, just fyi, posts have to be tradfn bodies or unnamed dfns/dervs.
 
I think (x∊i)∨~x∊t can be just ~x∊t~i
 
@H.PWiz Yes.
@PaulMansour Besides for H.PWiz's comment, an obvious golf is ∨~
 
6:59 PM
@H.PWiz Very nice. I was so focused on extracting a train, I lost sight basic logic!
 
@PaulMansour So for posting, ⎕@{~x∊t~⎕}(t←⎕)⍳x←⎕ is the best I can see right now.
@PaulMansour Try it online!
@PaulMansour If you follow the link then press Esc,S,G it will copy a ready post to your clipboard. You can paste that, but just remember to adjust the byte count from 35 to 19. Then go ahead and post your very first official code golf solution!
 
 
1 hour later…
ngn
8:18 PM
(t(⊃n,⍨⊣⍳∩)~∘i)¨x ⍝tnix=⎕⎕⎕⎕
 
@ngn I.e. saves one byte?
 
ngn
@Adám two, if i'm counting correctly
 
⎕@{~x∊t~⎕}(t←⎕)⍳x←⎕
(⎕(⊃⎕,⍨⊣⍳∩)~∘⎕)¨⊃⎕
 
ngn
@Adám no before x in mine
 
@ngn Oh, my typo. Yeah, 2 then.
 
ngn
8:26 PM
if only apl had nulls and coalesce
 
@ngn What?
 
ngn
@Adám dyadic could return nulls for not found. and then coalesce could fill them in with the desired value n
 
@ngn K?
 
ngn
@Adám some version of, yes
 
K is not a programming language. K is a family of programming languages.
@ngn Maybe you can submit a solution in some version of K.
 
ngn
8:35 PM
@Adám true
@Adám they call coalesce "fill" in k iirc. unfortunately none of the tio ks has it.
sql has nulls and coalesce() but it's not fit for golfing
 
@ngn tell that to all the T-SQL golfers out there
 
ngn
8:54 PM
another byte: t∘(⊃n,⍨⊣⍳i~⍨∩)¨x
 

« first day (897 days earlier)      last day (1774 days later) »