« first day (1710 days earlier)      last day (926 days later) » 

5:50 AM
Is there any similarities between AWK and APL?
 
6:01 AM
i dont think so
the syntax is kinda like C unless you are talking about something else
 
 
13 hours later…
6:46 PM
@Adám Thanks - and you are right, this solution is definitely the most readable yet. I've updated my answer on Code Golf Stack Exchange accordingly.
 
 
3 hours later…
9:38 PM
Is it possible for an inner dfn to access the of an outer dfn, or is this something I shouldn't do / a sign that I need to refactor my code?
I was attempting to write a function that draws a hollow square of #s (codegolf.stackexchange.com/questions/98866/…) and this is all I could come up with:
      {' #'[∘.{⍬≢⍺⍵∩0 (n-1)}⍨⍳n←⍵]}5
#####
#   #
#   #
#   #
#####
 
you assign the outer to a variable, and read that
 
So, like n←⍵ in my example?
 
yeah
nothing better than it in general
you can sometimes pass it as an arg or an operand, but that's rather ugly in most cases
 
I see, thanks!
(That was ⎕IO←0, for ⎕IO←1 it would look something like {' #'[1+∘.{⍬≢⍺ ⍵∩1 n}⍨⍳n←⍵]} I think)
 
⎕←{∘.∨⍨1⍵∊⍨⍳⍵}5
 
9:48 PM
@dzaima
1 1 1 1 1
1 0 0 0 1
1 0 0 0 1
1 0 0 0 1
1 1 1 1 1
 
Wow that's so much better, thank you
The ⍬≢⍺ ⍵∩1 n part really didn't feel right
That doesn't just feel like a great solution in the context of code golf but also a great solution in general. I wonder how often the shortest solution also happens to be the best one in APL, at least for small problems like this
 

« first day (1710 days earlier)      last day (926 days later) »