« first day (120 days earlier)      last day (2539 days later) » 

12:40 PM
Sending good vibes to Aaron Hsu (and his glamorous assistant @mkromberg) for their Functional Array Funhouse workshop today @lambda_conf
 
 
2 hours later…
3:04 PM
@Uriel Welcome!
 
hi :)
@Adám I lookep up some of the youtube links. remember the `⊢` you used over there?
https://codegolf.stackexchange.com/a/117470/65326 I couldn't figure out why was it working or needed, and why it couldn't be applied to this one https://codegolf.stackexchange.com/a/116947/65326
 
@Uriel Short answer: Because of +/. I'll explain.
@Uriel Trains (tacit functions) are by default (without parentheses) parsed as in groups of three, and only the left-most one will be a pair of two if the total number of items is even.
So, 273.15 459.67 0 0-⍨4⍴63 35÷⍨45×183.205+⊢ is 273.15 459.67 0 0-⍨(4⍴(63 35÷⍨(45×(183.205+⊢))))
While 100=+/17-⍨⎕AV⍳⊢ would be 100(=+/(17-⍨(⎕AV⍳⊢))) and is not what you want. rather you want 100=(+/(17-⍨(⎕AV⍳⊢))) notice the leftmost parentheses begins to the right of the equal sign.
 
@Adám so how will a train like + - × ÷ * ⍟ 1 be parsed? (regarding where will the 1 be inserted)
 
@Uriel Why was it needed? Because otherwise you would have had 273.15 459.67 0 0(-⍨4(⍴63 35(÷⍨45(×183.205+)))) which is meaningless.
@Uriel That isn't a train. Trains must end with a function.
 
3:19 PM
I meant the train without the 1 used with 1 as argument
 
@Uriel + (- × (÷ * ⍟)) which is + ((-1) × ((÷1) * (⍟1)))
@Uriel Here's a trick. Execute ]box on -trains=parens.
Now you can enter any train, and APL will tell you how t will parse it.
 
how do I call it from the repl?
 
@Uriel How do you what? And what do you mean by "repl"?
@Uriel This?
 
the workspace on the dyalog interpreter
 
3:35 PM
@Uriel You can also use my Train Explorer. Lowercase=function, uppercase=constant.
@Uriel Just enter ]box on -t=parens
 
@Adám oh, got it
anyway, can't use tio links because of firewall issues
 
@Uriel You can define the Train Explorer in your workspace:
 pics←Train train;id;monad;dyad;expr
 ⎕SHADOW,¨⎕A,819⌶⎕A
 :For id :In ⎕A
     ⍎id,'←''',id,''''
 :EndFor
 :For id :In 819⌶⎕A
     ⍎id,'←{⍺←⊢ ⋄ ''('',⍺,''',id,''',⍵,'')''}'
 :EndFor
 expr←'''⍺''(',(,' ',⍪train),')''⍵'''
 monad←1↓¯1↓⍎3↓expr
 dyad←1↓¯1↓⍎expr
 pics←↑monad dyad
Then try:
Train 'a b c d e f'
Train 'f X g h'
@Uriel You know how to define a program like that?
 
3:56 PM
@Adám I can understand it, but definitely not write it up
 
@Uriel You can copy the text the the clipboard, then enter )ed zyx and then paste it in (and make sure the first line is right (you don't want the line with just "xyz"). Press Escape to save, and you're all done.
@Uriel Alternatively, just enter the following single line into your session:
⎕FX ' pics←Train train;id;monad;dyad;expr' ' ⎕SHADOW,¨⎕A,819⌶⎕A' ' :For id :In ⎕A' '     ⍎id,''←'''''',id,''''''''' ' :EndFor' ' :For id :In 819⌶⎕A' ('     ⍎id,''←{⍺←',(⎕ucs 8866),' ⋄ ''''('''',⍺,'''''',id,'''''',⍵,'''')''''}''') ' :EndFor' ' expr←''''''⍺''''('',(,'' '',⍪train),'')''''⍵''''''' ' monad←1↓¯1↓⍎3↓expr' ' dyad←1↓¯1↓⍎expr' ' pics←↑monad dyad'
 
@Adám you should definitely post this as a challange :P
 
@Uriel What? The entering :-P or creating a Train Explorer?
@Uriel Ah, now I couldn't help myself but to golf it:
↑⍎¨3 0↓¨⊂'''⍺''(',(,' ',⍪⍞),')''⍵'''⊣{⍎⍵,'←{⍺←⊢ ⋄ ''('',⍺,''',⍵,''',⍵,'')''}⋄⍬'}¨819⌶{⍎⍵,'←''',⍵,''''}¨⎕A
 
4:30 PM
@Adám MY EYES HURT
 
@Uriel Yeah, well, you don't have to golf APL. That's why I wrote it as I originally did.
 
@Adám before I looked it up on wiki I was pretty sure it was built as one of these jelly-osable-like golfing langs
 
@Uriel Oh no, APL is as real and practical programming language as they get.
WHich is why I think it is the best golfing language. Not always shortest, but the only real-world language which regularly stands a chance in code-golf. Learning APL for fun gives skills that can be used in a career. How many jobs are there for Jelly programmers?
Btw, do you know that Jelly is based on APL?
 
yea, tacit programming. it's mentioned in the github readme i think
but, well, the jelly interpreter is much smaller than the 260 MB dyalog one
@Adám actually, SO has more jelly than apl questions
too bad it's not THAT jelly.
 
@Uriel Jelly has way less features than APL. Dyalog APL comes with Java/C# style OO, full support for .Net, WinForms, TCP/IP, PCRE, and loads of other utilities.
 
4:42 PM
so you use to golf your code when building it?
or may that get you fired?
you can never know with APL
 
@Uriel No, I don't golf my production code, but participating on PPCG is part of my job description!
@Uriel I wouldn't get fired. In fact, a former co-worker (sadly passed away) used to use a specific golfed expression so much that we special-cased it in the interpreter for optimal performance.
53
Q: Count trailing truths

AdámInspired by, and in memory of, my dear friend and colleague, Dan Baronet, 1956 – 2016. He found the shortest possible APL solution to this task: Task Given a Boolean list, count the number of trailing truth values. Example cases {} → 0 {0} → 0 {1} → 1 {0, 1, 1, 0, 0} → 0 {1, 1, 1, 0, ...

 
Dan wasn't outgolfed by dennis :shocked_face:
 
@Uriel No, occasionally Dennis meets his match.
 
@Adám well, if i ever develop a language, i will try to make sure it has a trailing truths 1- bit builtin
or, even better, as stuck did to hello world
 
@Uriel haha, but it wouldn't qualify according to our default rules.
 
4:58 PM
@Adám well, i could spend time developing a highly intelligent natural language engine that parses the page the question is on, understands the challenge specs and follows it
but that's the day PCCG gets offline
 
im pretty sure this will be considered as a loophole
and anyway, im not that efficient and concise using english
 
 
5 hours later…
9:46 PM
7 messages moved to trash
 

« first day (120 days earlier)      last day (2539 days later) »