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

02:27
Un-directed Programming: sacrideo.us/un-structured-programming
Very nice way to leverage APL's terseness. Definitely going to have to play around with this.
 
4 hours later…
06:27
@Adám No worries!
 
1 hour later…
07:46
To everyone here, out of curiosity, what first got you interested in APL?
Uh, I suppose babies are just naturally interested in everything.
08:07
I was going through all the programming languages listed on Wikipedia, saw APL and after seeing some friends talking about it I decided to try it
i randomly found some videos on youtube (probably code_reports leetcode solutions) and was immediately enthralled by the mishmash of greek letters and other wacky symbols.
now i have a question. last week i mentioned i was going to make a thermophysics project with an apl backend. i have created the backend in apl, no problem, but it seems stencil of any kind doesnt work in pynapl. im trying to port the apl code directly to python with pynapl.
so i wonder
1) if you have a way to define ({⍺↓⍵}⌺3 3) without the use of stencil or
2) if you know a way to use stencil in pynapl.
or actually, if none of that works, do you have a good algorithm or way to implement stencil, so that i can port the algorithm itself to python?
08:24
@B.Wilson through code golf, but not really dabble into it too much until i hear about the competition
09:10
@B.Wilson looking for some Unicode symbols, "oh what's this 'APL FUNCTIONAL' thing?"
LOL
09:51
@B.Wilson 1 + 2 3 4
@Slimey I'm very confused as to why stencil wouldn't work. do and work?
is there any way to make (0@2 2)3 3⍴⍳9 change the element in the middle of the 3x3 array to 0, instead of the middle row?
@Adám i can test it
btw, your 1) makes little sense to me. missing ?
@Slimey missing in 0@(⊂2 2)
otherwise, you're nulling row 2 twice.
right, missing ⊂ for 1)
is it just an @ thing to work that way with enclosed arrays? i feel like im missing something very fundamental when it comes to ⊂
yesterday i messed around with it a little and i could use it to kind of map over the left argument instead using something like {⍺ f¨ ⊂⍵}
@Adám monadically? yes. dyadically? i dont really know how to use them dyadically
hold up {⊂⍺↓⍵}⌺3 3⊢3 3⍴⍳9 works now
im pretty sure i tried that
10:07
I'm still curious about a model for {⊂⍺↓⍵}⌺3 3, I'm sure it can be done very simply
wait, it only works in eval, not in fn.

f = apl.fn("{⍵-⍨({m←2 2⌷⍵ ⋄ ⊃((-∘m+⌿)÷(-∘1≢)),⍺↓⍵}⌺3 3)⍵}")

print(f(apl.eval("3 3⍴⍳9")))

it gives a LENGTH ERROR
Given a co-ordinate, a window-size and an argument return the elements from the window placed over the specified position
@finooiigee my thoughts exactly
10:19
simpler example with LENGTH ERROR that doesnt use my actual function

f = apl.fn("{⊂⍺↓⍵}⌺3 3")

print(f(apl.eval("3 3⍴⍳9")))
am i misunderstanding how to use this stuff?
10:45
@Slimey Can you try an even simpler example? print(apl.eval("{⊂⍵}⌺3⍳9"))?
11:01
works just fine
it seems eval statements work, but not the fn
11:19
@Slimey So if you take this simpler one and wrap it in a fn, it doesn't work? Log an issue.
this worked apparently
f = apl.fn("{⊂⍵}⌺3")
print(f(apl.eval("⍳9")))

i shouldve tested that. it seems this:
f = apl.fn("({⊂⍵}⌺3 3)")
print(f(apl.eval("3 3⍴⍳9")))
doesnt work
Ah, it doesn't know how to handle tacit functions.
doesnt it? it works fine like this:
f = apl.fn("+⌿÷≢")
print(f(apl.eval("⍳6")))
didnt work to wrap the stencil in a dfn either
f = apl.fn("{⍴⍵}")
print(f(apl.eval("3 3⍴⍳9")))

prints 3. something weird happens when the function is passed the evaluation
this works. something weird must happen when you pass a function an evaluated expression.
f = apl.fn("{({⊂⍵}⌺3 3)3 3⍴∊⍵}")
print(f(apl.eval("3 3⍴⍳9")))
@Slimey Maybe it fails to separate the right operand from the left arg of ?
11:34
in 3 3⍴⍳9?
hold up, this works
f = apl.fn("{⊂⍵}⌺3 3")
print(f(apl.eval("4 4⍴⍳9", raw=True)))
i have to use raw to tell it to not do python conversion weirdness
12:07
well, i can work with this. thanks for your help.
Is there a way I can convert a ⎕JSON⍠'M' matrix to a namespace whilst maintaining duplicate items?
⋄⎕JSON ⎕JSON '{"h2":"Hello,","h2":"World!"}'
What I want is to be able to do body.h2 and get back 'Hello,' 'World!'
12:34
@finooiigee Namespaces cannot contain duplicate names.
Yeah, I've found that I need to surround the h2 elements in unnamed namespaces and place those in an array
Makes going from ⎕XML to a namespace non-trivial :(
@finooiigee O.o That's malformed JSON, to boot. Map keys need to be unique.
The JSON spec specifies duplicates
13:29
@finooiigee AFAIK, the spec is just silent about duplicate keys. You'll end up hitting lots of implementation-defined differences in the wild though.
 
1 hour later…
14:54
0
Q: What conditions does ]Save in Dyalog APL have?

BnengonSo I recently started learning about Dyalog APL and now I have a function that I would like to save, but when ever I try to use ]Save according to the help text provided by it I only get 'Invalid object' or 'DOMAIN ERROR' and sometimes just "Command interpreter returned failure code 1" as an Erro...

 
8 hours later…
22:31
@finooiigee I highly recommend XQuery for this type of task

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