« first day (2578 days earlier)      last day (2266 days later) » 

10:01 PM
@Adám ∘.O why? I'd give that up for more logic
 
@dzaima Well, we can't remove functionality now, can we? Constructs like //⎕VFI are really useful.
 
Anonymous
1 message moved to Trash
 
Anonymous
Get outta here, spam
 
@Adám yeah, I guessed backwards compatibility. But IMO using / to insert a function between a guaranteed 2-item array is a bit strange
 
@dzaima Why? Basically / converts (scalar) functions from infix to prefix. (Mixed functions need a ).
 
10:09 PM
@Adám because if the input array happens to not be 2 items, very strange things will happen, and I'd expect an error there rather than garbled results
 
@Mego Can we get betseg to translate :p
 
but that's coming from a Java (ish) user :p
 
@dzaima You said "guaranteed 2-item". And, not necessarily: For associative operands, it works fine.
 
Anonymous
@Zacharý It was spam
 
@Adám To address your comment on that spam post, it's probably (I'm guessing) because your Hammer only applies to duplicate votes
 
10:12 PM
@Mego Are you sure?
 
It depends on what CV you used
 
@DJMcMayhem Ah, I used "close as Turkish prompt for website feedback". Never knew we had that as an option /s
 
> What do you think about your personal website, and I wonder if there is any other code I should add. Thanks so much already. Site content is KOSGEB loan, Eligible Loans, Interest Free Loans Eligible Loans ORG
 
@Adám yeah, I meant "supposed-to-be 2-item", and yeah, it works fine sometimes, but very much the opposite in others
 
I'm pretty sure that's spam
 
Anonymous
10:13 PM
@Adám Yes
 
@DJMcMayhem I can only imagine a google employee rigging google translate and posting a normal question (but not in english) just to see if it gets deleted :p
 
@dzaima If it doesn't, then you have a logic problem in your code. Of course you could make the operator Prefix←{⊃(⍺⍺/)x y←⍵} to throw an error on non-2-item arguments. But that is oddly specific, isn't it?
@dzaima Fancy: Prefix←{⍺≠≢⍵:⎕SIGNAL⊂('EN' 5)('Message'('Right argument must have length ',⍕⍺)) ⋄ ⊃(⍺⍺/⍵)}
 
@Adám I've had use cases when I had a 2 item array (for ease of inputting it) and applying a function that can easily access both either requires me to use ⊃⍵ and 2⊃⍵ in the code or using the bulky {(2⊃⍵) ⍺⍺ ⊃⍵} (though even those don't error-check). I suppose the problem stems from that APL doesn't have a good way to get more than 2 (to 4) arguments
(which lead me to considering making a language which can have an arbitrary amount of right and left arguments)
 
@dzaima You mean dfns don't have a good way? They do though; you can use x y←⍵. Tradfns have namelist right arguments.
 
@Adám oh yeah that works.. I always forget about being able to multiset variables
 
10:29 PM
@dzaima Also, do you know about arbitrary unpacking? Try it online!
 
@Adám Wizardry!
 
CMC: why is APL so darn magical
 
@J.Sallé Isn't for nothing that APL is the Array Programming Language
 
Indeed
 
@Riker (Shouldn't that be CMQ?) Because APL was and is developed by some really clever people, as opposed to other programming languages which (after the initial idea by some clever persons) are developed by the general populace.
 
10:35 PM
Runtime warning: Cycle in spine detected. - basically, the compiler says "get your filthy hands off of my graph and let me do my thing properly"
 
@Οurous after all, it'd be presumptuous to assume you can graph harder than the compiler
 
PSA: The AP Computer Science course from Collegeboard mixes tabs and spaces. Our next generation of learned coders is doomed.
 
More APL wizardry: Selective indexed modified assignment. Pure magic!
 
@Adám wait what
 
@J.Sallé (I've turned boxing on in that link.) First we pick the 3rd element's 2nd element, then we index into that to get the 1st letter. Then we lowercase that in-place, in the style of other languages' compound assignment += but we use a user-defined function instead of the +.
 
10:45 PM
@Adám The boxing makes it much easier to see
 
@J.Sallé Should boxing be on by default?
 
@Adám Well, I find it much easier to see, so I'm not opposed to it.
Although if it'd be on by default on TIO, would we have to turn it off to submit answers?
 
@J.Sallé If it was on by default, it would probably only be for output generated in the session (i.e. the Input field on TIO), and not for output generated by functions. In any case, TIO runs with an empty session, so no SALT. And boxing requires SALT. (and UCMDs).
 
@Adám Oh, I see. If that's the case, I'm 100% for it.
I could just stop being lazy and save that whole line for enabling boxing somewhere >.>
 
@J.Sallé Btw, you do know you can turn boxing on permanently on you local machine, right?
 
10:56 PM
@Adám python supports similar nested unpacking
 
@Adám Yeah, mine's on.
 
@J.Sallé Bookmark this: APL
@Uriel Cool. Can you show me an example?
 
ngn
@Uriel javascript too
 
@Adám that moment when I press Ctrl+D to bookmark a page and it types on the address bar instead ⍨
(Had the wrong keyboard layout selected)
 
@J.Sallé Have you tried mine?
 
11:01 PM
 
@Uriel Neat. Can it do selective and/or indexed assignments too? And modified assignments?
 
@Adám sure, lists have all kinds of insertions, deletions and modifications
That's python, not some C
 
@Uriel E.g.?
 
@Uriel Ah, I see. They achieve the same (and more, actually) but just not with a unified syntax. How would you do this?
 
11:19 PM
@Adám both are not really complicated, but I'm on mobile so writing code isn't much comfy
 
@Uriel Oh, I'm sorry. Another time then. I have to go to bed soon too. Stay happy!
 
ngn
@Adám python doesn't have a built in "flatten", but if it did: Y[:] = range(len(flatten(Y)))
 
@Adám I have not. I’ll give it a spin when I get home.
 
ngn
@Adám python actually beats apl there
 
@ngn Show me!
 
ngn
11:21 PM
@Adám you can assign to a[start:end:step]
 
@ngn Oh, bad example then. But again, so many ad-hoc syntaxes/functions.
 
ngn
@Adám in general apl's assignments are, of course, much richer and can be combined recursively
 
@ngn Let's come up with a good example for a challenge.
 
@Adám it's Adar, how can one not?
 
@Uriel Exactly.
 
ngn
11:25 PM
@Adám in my latest "tetris strategy" challenge one could use modified assignment to put the tetromino on the board :)
@Adám with something like ((⍴tetromino)↑row col↓board) ⌈← tetromino
@Adám or maybe board[,row col∘+¨⍳⍴tetromino] ∨← ,tetromino
 
@ngn Or 1@((⊂row col)+⍸tetromino)⊢board
 
ngn
@Adám yeah, but you were talking about assignments...
 
@ngn Sure. But I'd want us to come up with some really fancy thing. Something like a combination of selective and indexed-with-elided-axes or something.
 
ngn
@Adám designing a challenge so a particular language can win? ;)
 
@ngn Absolutely. :-D
 
ngn
11:42 PM
@Adám has it occurred to you, it's a pity that apl's modified assignment works only with dyadic functions?
 
@ngn Yes, it bothers me on occasion. Why can't I write array-← ?
 
ngn
@Adám for that particular case: array-⍨←0 but in general you can't
 
@ngn array(-⊣)←⍬ works though. And with atop, array-⍤⊣←⍬ should work as well.
 
ngn
@Adám neat
 
@ngn Has is occurred to you, it's a pity that APL's modified assignments in dfns works only with anonymous functions?
 
ngn
11:47 PM
@Adám er... what? why?
 
@ngn Because in dfns, ⎕SHADOWs the names on the left before assignment.
 
ngn
@Adám I don't understand
@Adám oh, I think I got it
 
@ngn Consider plus←+ ⋄ array plus←5 Now compare to {plus←+ ⋄ array plus←5} which really means {plus←+ ⋄ ⎕SHADOW¨'array' 'plus' ⋄ array plus←5}
 
ngn
{f←{⍺+⍵} ⋄ a←3 4 5 ⋄ a[1]f←1 ⋄ a}0 ⍝ returns 3 1 5, not the expected 3 5 5
(⎕io in the above is of course 0)
 
@ngn Yes, but removing the braces makes 3 5 5. Wat. (I do understand why.)
 
ngn
11:53 PM
@Adám apl weirdness
 
@ngn You can "escape" f with {⍺f⍵} though.
 
ngn
@Adám or f∘⊢
 
@ngn Yes, or with atop (easier to understand than , imho).
@ngn If assignment namelists required parens (like in APL2) there would be no problem or ambiguity.
@ngn Or if assignment was a regular function taking a character left argument instead of a weird symbol list. (Somewhat the case in SAX and J.)
 
ngn
this concept of local variables being "shadow blocks on the stack" rather than "slots" is poisonous
 
@ngn Yeah, I think that was a kludge made to shoehorn dfns into an interpreter that wasn't designed with it in mind. I'm surprised it doesn't have significant performance impact.
 
ngn
11:58 PM
it led to the longest-lived bug in dyalog, the infamous #17
 

« first day (2578 days earlier)      last day (2266 days later) »