« first day (1533 days earlier)      last day (1132 days later) » 

9:11 AM
@user15553252 Welcome to the room. We we be of service?
(Btw, your avatar and display name will change to match your choices after a little bit of activity.)
 
9:49 AM
@Adám thanks!
btw, currently fighting with dyalog-competition :) a lot of fun!
 
Good to hear. Obviously, I can't directly help you with that, but if you run into problems with APL in general, or if you need to learn something, I am here for you, and so are many others. How would you characterise your level of APL knowledge?
 
for sure! didn't expect any support!!! :)
beginners level, I started with gnu apl end of last year, read 'apl at a glance' and 'apl in depth' and did advent of code mainly in APL. With this year, I switched over to Dyalog APL - for being more modern. Now my objective is to have at least a solution (even if ugly) for all the competition tasks.
having a common lisp background, APL feels alien but VERY interesting.
 
Well, I wish you the best with it.
 
 
1 hour later…
11:03 AM
@Adám this is expensive :) amazon.it/dp/0471430145
 
11:22 AM
@k1m190r Yeah, but the full thing is available in digital format from apl.wiki/A_Programming_Language#External_links.
 
11:47 AM
cool cool
 
 
1 hour later…
1:04 PM
Announcement: All videos from APL Seeds '21 are now available.
3
@rak1507 @Razetime ^
 
1:27 PM
wooo
 
1:58 PM
Can I install Dyalog on two machines with one registration code? Just want to avoid any trouble.
talking about free non-professional registration
 
2:09 PM
Yes as long as you only use it in one machine at any one time - see clause 4.2 of the licence agreement:
4.2 You may install each version of the software on more than one computer provided that it is used on one computer at a time
That said, the unregistered version is completely identical to the registered one…
 
2:35 PM
is the #apl-orchard channel on discord linked here, or is that a plan for the future?
 
for the future
 
 
2 hours later…
4:09 PM
@Adám brilliant! :D
CMC: increment all items in a vector apart from the first ( @Razetime ;) )
 
RGS
@rak1507 (⊃,1+1∘↓) ?
 
there's a 6 (3 of them, but they're all basically the same)
 
RGS
ah code golf, ofc
 
⊃,1+1↓ in dzaima/APL ;-)
 
neat
 
4:21 PM
@rak1507 ;)
 
@rak1507 ⊢+~⍤⍷⍨
Or 1-⍷⍨-⊢
 
yay, remembered the ⍷⍨ trick
 
RGS
Ah, clever
 
4:41 PM
This cropped up on HN (again) today: norvig.com/java-lisp.html flownet.com/ron/papers/lisp-java -- maybe we should do an APL version?
 
APL as an alternative to ???
 
The orgiginal compared Lisp, Java and C++.
Norvig arguing (unsurprisingly) for Lisp being the superior choice. It just looks like the task would fit APL.
 
5:04 PM
what is the task?
 
Consider an old-skool phone keypad (if you're old enough you may have used a land line att some stage). The buttons have letters, too, so that you can memorise phone numbers by means of the words they spell out. SO: given a huge list of numbers and a dictionary (in German), return all possible words that the numbers can spell.
 
Data here
 
sounds like one big outer product to me
 
Indeed.
Although some complications (phone numbers may contain slashes and dashes, dictionary seems to predate unicode etc).
Could have made a good Dyalog competition problem, perhaps
 
5:09 PM
@Adám Thanks for the date range APL code @Adám
 
@wgajate No problem. Let me know if you need anything there explained, and/or if you would also like to format your dates to text.
 
@Adám cool installing on the second then :)
 
5:41 PM
Had some fun with challenge by José Valim (creator of Elixir) -- github.com/josevalim/nested-data-structure-traversal/pull/22/… -- I'm sure it's still quite golfable but that's probably not the goal. They're collecting different ways to solve the problem. Most non-FP solutions use mutation, most FP solutions use reduce, APL uses ... well ... partition :D
I guess if they want to understand my solution I should comment it a bit :D
 
RGS
what's the challenge?
 
See the repo README. Basically adding indices to records with a twist
ie. the nested records (Lessons inside the Sections) share a global index space and the indices can optionally get reset if the section has a reset: True boolean field.
 
6:07 PM
TTH (Time Till Hieroglyphics-comment): 19min. Pretty decent 😂
 
@MartinJaniczek Where?
 
> Also thanks for the explanation haha. I wasn't sure if I was looking at alien hieroglyphics or slightly encrypted NES cheat codes.
 
RGS
Btw, not sure if I understood 100% yet but the reference solution has 2 falses and 1 true
and your solution has 2 true and 1 false..?
 
6:23 PM
Yes I've modified the first reset to work better with Partition/P.Enclose (can't remember which)
 
RGS
ah so that's not a problem?
 
Mentioned in the PR that it should be a no-op anyways (for all inputs i, output(i with first section reset = True) == output(i), but that I can change my code to fix that (I'd use @ for the algorithm instead of indexed assignment and then use the old resets array for the output) but they were fine with it as is
 
RGS
@MartinJaniczek btw funny how your header mixes ⋄ and ⊣ :-P ⎕SE.UCMD'box on -f=on'⊣enableSALT⊣⎕CY'salt' would also work
 
This was copy pasted from Adám's TIO when I asked him how to do boxing in TIO a few months ago :)
can't remember how to do that
 
 
1 hour later…
7:35 PM
CMQuiz: In what situation are both and →3 valid?
 
7:47 PM
CMC: In the following dfn, what is the shortest code you can replace [placeholder] with so that the function always reaches and then returns the 42 when called?
Foo←{
    [placeholder]
    0
    42
}
 
42?
 
Aw man. I didn't mean that. Hm. How can I rephrase this?
I could replace the 42 with a very long random sequence.
 
ok
 
Note that you cannot modify the 0 line, so something like this isn't valid:
dummy←{
⍵}
 
how about a←∇⋄⍎⊃1↓⌽↓⎕CR'a'
could be shorter depending on ⎕IO
 
7:54 PM
Nah, that's cheating too. You're returning a different 42, not that one.
 
:(
 
Essentially, all you have to do is implement →3 for a dfn.
 
I don't know all the arcane APL magic tricks you do
 
I just discovered this hack now, when researching for my next webinar.
I've now implemented a utility function GoTo such that this is a real session transcript:
Foo←{
     GoTo ⍵
     20
     30
     GoTo 3
     50
 }
      Foo 2
20
      Foo 3
30
      Foo 4
30
      Foo 5
50
 
oh no
 
8:03 PM
So now I can conditionally skip lines in dfns :-)
 
this makes me sad
 
@rak1507 +1
 
Hm, it has a side effect… let's see if I can get rid of that.
 
oh no, impure gotos, it's a functional programmers worst nightmare
 
@Adám what does it do with multiple -separated statements in a single line?
 
8:05 PM
@dzaima Nothing special. It is a true so it just branches at the point it is called.
 
so it's a go to line, not go to n'th statement
 
Correct.
I didn't actually implement , I just found a hacky way to make the interpreter accept in a dfn.
 
@Adám that's what i was thinking, as, with forbidden, nothing else would make sense
 
@dzaima I didn't say was forbidden. In fact, I use
 
@Adám right, i'm playing with too :p
 
8:09 PM
But a plain ⍎'→3' is rejected by the interpreter.
 
how does one quickly exit out of all ⎕SI?
 
)sic
(the "c" stands for "clear")
OK, I managed to get rid of almost every trace of side effect. My GoTo temporarily sets a variable, but it makes sure to erase it afterwards, and I can use an arbitrarily unlikely variable name, or even amend my implementation to choose a variable name that isn't in use.
 
(and why do i get into the ⎕SI-ed state without the tracer opening now?)
 
There's a setting for that. Did you change it?
 
probably. I don't want to start in the ⎕SIed state too though
i want absolutely zero debugging/tracing stuff unless i explicitly ask for it
 
8:15 PM
You can set a global trap that just cuts the stack back.
 
oh god
is that really what's needed to just not have the REPL change state on every error?
 
I think so. It is pretty simple to do it: ⎕TRAP←0'E' '→'
 
@Adám that doesn't give any error messages
I still want it to print the error lines, but just also leave me in the REPL place I was at before
 
Ah, right, then ⎕TRAP←0'E' '↑⎕DM'
Doesn't print the extended error message, but it is trivial to amend this to do so too.
I should add it to APLcart.
 
@dzaima (i.e. what literally every other REPL I've ever used ever does)
 
8:21 PM
Sure, but APL has this really nice thing where you can sit inside your suspended code, fix it, and continue.
Allows interactive programming.
 
@Adám that's an option in JS too, but you're not shoved that down your throat on literally every error ever
 
Fair enough.
My father taught me top-down programming, where you use names you've not defined yet, and then the interpreter asks you "what does that mean?" (i.e. VALUE ERROR) and you define the missing name (maybe in terms of other missing names) until you've implemented your program.
 
I've probably lost like a second of time on every error Dyalog has thrown at me by just having to hold down esc (and then many more seconds reopening every editor window that has been closed by the esc spam)
@Adám i mean, yeah, but that doesn't work when you're editing stuff
 
Why not?
@dzaima I think simply entering would have worked for you instead of leaning on Esc.
 
@Adám you have code executing both before and after the thing being edited
@Adám I have to spam-enter too, and →<enter>→<enter>…→<enter> is way slower than esc*
 
8:25 PM
@dzaima In that case )sic should do the trick.
My father had )sic<Enter> on an F-key.
 
@Adám makes sense
@dzaima (and in this challenge specifically, i also have to have a full dfn and code a specific number of lines after the thing being written, and I just have to spam different erroring things until one works; a )sic in between each like doubles the time it takes to do stuff)
 
OK, my GoTo is now complete. No side effects, and no risk of using any existing name.
 
@dzaima (not to mention each there is <alt>+], making for an extremely uncomfortable (<alt>+] <enter>)*)
 
That's really easy to type for me ¯\_(⍨)_/¯
 
@Adám try typing it 4 times in a row as fast as you can
 
8:32 PM
Takes a fraction of a second each time.
 
takes like 0.5s for me, so 4 times means 2 seconds, which is way too long for what should take precisely 0 seconds
 
Oh, found a shortcoming in my GoTo: It equates →⍬ to →0 while it should really let execution continue. I can probably make it go to the next line, but I don't think I can make GoTo ⍬ ⋄ here work right.
@dzaima Bind →<Enter> to a keystroke!
Or set that trap.
 
@Adám i'd rather bind )sic to one (or not use Dyalog at all :) )
 
Free world.
 
and esc is already pretty much a keystroke for →<enter> with the tracer open
 
8:35 PM
Except →<Enter> won't close your editor.
fwiw, I also don't like that Esc focuses the editor if any is open.
Too much overloading of keystrokes.
 
( and )sic also spam the history log)
 
Same thing with Undo/Redo being shared with Prev/Next. Ugh.
@dzaima Yeah, I wish there was a way to let F-keys execute things without affecting the session.
 
or just have a sane REPL y'know
it's a REPL not a REP)sicL
 
I must've disabled the debugger or something at some point because it's not popping up when I do things that error
 
APL never claimed that its interactive session was a conventional modern "REPL".
 
8:39 PM
@rak1507 does ⎕SI increase though?
 
OK, fixed the GoTo ⍬ problem (except for s).
 
@dzaima no idea
 
@rak1507 try executing an erroring multiline dfn and see if ⎕SI is non-empty
 
Anyone wanting to see my GoTo, stay. If you're of a weak constitution and cannot handle a bit of APL pornography, look away now.
 
oh it has to be multiline
 
8:40 PM
OK, you were warned:
GoTo←⍎'-⎕TRAP←0''E'' ''⎕TRAP←⍎''''_''''⍴⍨≢⍉⎕NL 2 ⋄ ⎕EX''''_''''⍴⍨≢⍉⎕NL 2 ⋄ →',⍕,',1+⎕LC''⊣⍎(''_''⍴⍨1+≢⍉⎕NL 2),''←⎕TRAP'''⍨
 
my eyes!
 
@dzaima (the idea that an error means everyone definitely wants to view local variables at the erroring location is just stupid)
 
I'm not adding that to APLcart.
@dzaima No, if you write a utility or and application, then you put a trap around the body of your code, so it behaves nicely from the outside.
 
@Adám what
 
If you write a utility function Util then begin it with:
Util←{
    0::'Unexpected error'⎕SIGNAL 999
 
8:44 PM
A thing I really like about Java is that when something in the stdlib errors, I get to look into the full stacktrace of its internals too
 
yeah I don't see why errors should be hidden like that
 
@Adám that is imo WAY worse than the utility erroring (at least with a generic "unexpected error" message)
it's a fault of Dyalog APL that you don't really have an overview of the stacktrace, and are forced into the deepest level
 
Uh, )si gives an overview, no?
 
@Adám if that's usable, then why would you ever do the 0::haha some error you now know nothing about
 
@dzaima I don't understand this message.
 
8:52 PM
@Adám if a utility I use from someone else errors unexpectedly, it hiding why that happened is absolutely the last thing I would want it to do
@dzaima (PS: I come from a world where, when a library errors, I try to do something about it, instead of buying consulting for the library)
(fwiw errors in Java can have a "cause" object, so you can even make a catch-all and throw new error, with a usefuler top stack item, while also not just completely destroying the extremely useful information about the specifics!)
 
9:15 PM
@dzaima Yeah, I'll keep arguing for a simpler way to "re-signal" an error while preserving the info. John also mentioned the possibility of shipping the actual error object along so you get the full picture at the bottom.
 

« first day (1533 days earlier)      last day (1132 days later) »