« first day (1819 days earlier)      last day (819 days later) » 

7:00 AM
@Fmbalbuena I usually wait until the end of the awarding period. When will you update your answer to my much shorter solution?
(Oh, and no need to remind me. SE does.)
 
 
2 hours later…
9:07 AM
@AndréLeria I'm basing a webinar on your CPF algorithm. Would you like explicit attribution by name?
 
 
5 hours later…
2:22 PM
@Adám is there a way to do pass-by-reference in APL?
my first thought was something like this:
  x←⎕ns⍬
  x.arr←?⍨1000000
  x←{(x.arr[5])←6⋄x}x
how efficient is it in practice?
 
2:33 PM
@Adám Thank you; fixed
 
@KamilaSzewczyk The only pass-by-reference you can rely on is that of namespaces. But they're not very fast.
 
i presume it's still faster than copying multimegabyte arrays too many times
plus i'd make use of this namespace as the arrays would ideally be tagged
 
Hello all, noob here. Is there a command to exit the Dyalog APL repl?
 
@Dincio )off or ⎕OFF
Also, welcome to the APL Orchard.
 
thanks that probably saved me a lot of googling
 
2:45 PM
While we're always happy to answer questions, next time, try searching APLcart
 
@Adám thaks
@Adám Ok, I will. Seems like a great resource.
 
@KamilaSzewczyk If you do modified/indexed/selective assignments, the interpreter will do them in-place. Your namespace does doesn't really achieve anything (and doesn't make much sense either).
 
@Adám really? so this doesn't make any copies?
  f←?⍨1000000
  f←{(⍵[5])←5}f
 
This has to, because of
Btw, the code isn't valid.
f←?⍨1000000 ⋄ f[5]←5 doesn't work for you?
 
it's, ideally, going to be a recursive function
i think i can't get away with doing operations on objects by name themselves.
 
2:51 PM
Maybe you can update a semi-global?
 
mmaybe
 
Maybe use tradfns, as they're not stuck with but you can in-place modify the argument array.
 
huh.
i didn't know about this
 
I was trying to setup dyalog apl on WSL with vs code
But the apl language server plugin for vscode doesn't seem to activate when I open an apl file
 
What extension does it have?
(Also, why not just run APL under Windows directly?)
 
2:55 PM
it's called "APL Language Server Client"
 
No, I meant what file extension does the APL file have?
 
Oh yes, .apl
I don't really know why I like to use WSL tbh haha I might try to do it directly in windows
 
Could it be that the plugin doesn't recognise that file extension? It isn't an extension Dyalog uses at all.
 
Oh I didn't know that. It seemed to work with vim running on linux
I'll try to change the extension
 
I'd try with .dyalog first as the safer bet, as that is the older extension used by Dyalog for source files. It'd be nice if .aplf and .apln (etc.) would work, though, as those are the new standard.
 
2:59 PM
this appears to be its list of extensions. :|
 
@Dincio Probably because the Vim extension was made with GNU APL in mind, and that uses .apl
@dzaima Why ":|"? That's perfect.
 
spot the dyalog employee
 
@Adám it doesn't have *.apl, the most generic APL extension
 
Adám is there a none function-axis & tacit version of ,[0.5] on the aplcart? I can't seem to find it. ↑⍤,⍥⊂ might be worth adding
 
@dzaima We considered using .apl for the new (shell) script ("#!") files, but decided against it because many other things use .apl
 
3:03 PM
@Adám Surely with a hash-bang it doesn't matter what the extension is.
 
It does on Windows, because that's what does the magic, not the first line or being "marked as executable".
 
@Adám literally all the files on github code search for path:*.apl are APL
 
Yes, because GitHub hosts code.
 
@Adám Meh, I forget Windows is a thing.
 
Also, it is nice to find all Dyalog sources with *.apl? which doesn't catch .apl
 
3:06 PM
It didn't work... I'm gonna try using vim, otherwise I'll resort to native windows
 
John D's talk on scripting from Dyalog '21 seems to suggest .apl
 
Yes, that was the plan at the time.
 
Ah it's changed since then?
 
@Dincio If you use RIDE, you can ask it to use Vim as its editor.
@FawnLocke Because ,[0.5] is incredibly involved to write. Hence my wanting <Y for that.
 
Oh? I'm on board with having < for that too.
 
3:10 PM
And then > for the "inverse" ,[⍳2] — again, quite involved to write.
 
@dzaima oh, cs.github.com limits to 100 results, and there are indeed non-APL .apls. But there's also at least one non-APL .apln
 
@Adám I'm not familiar with RIDE, is it an editor for apl?
 
RIDE is the 'standard' IDE for non-Windows. It's nice.
 
Kind of. It is a cross-platform GUI frontend for the interpreter.
 
Ok I found it (my googling skills are a bit flimsy today haha), I'll try it if the vim way doesn't work, thanks
 
3:14 PM
@Dincio I recommend using 4.4beta over the released 4.3
 
@Adám well their fault for taking the extension of an existing language name
 
@FawnLocke Is ↑⍤,⍥⊂ any better than the existing {↑⍺⍵}?
 
I don't think so, It might be nice if someone wants to avoid using dfns in trains for whatever aesthetic/ideological reason beyond that /shrug
 
But this is why I want to make <Y be ,[0.5] so you can write the (objectively better‽) ⍪⍥<
 
Yeah, that'd be quite pleasant
 
 
2 hours later…
4:53 PM
@Dincio (APL noob here as well) one thing someone (probably @Adám) here told me a few days ago is to google "dyalog apl" to cut on the noise. Unfortunately APL is not a very distinctive name (worse than Haskell, though better than J ha ha).
 
But in general, you're much better off searching APLcart and APL Wiki directly. If you use DuckDuckGo, you can use the "bang" !aplcart
 
@Adám yes, of course. @Adám, speaking of APL Cart, one improvement that would be nice for it is to overload each entry with some synonyms. Sometimes I look for a concept with my own words and I don't find what I am looking for till I try many other queries. For instance, in most cases array and matrix would be synonymous (not strictly speaking in APL, but for the casual user of APLcart).
 
@Adám Is there a collection of commands? like square←{⍵*2}⋄hypercube←{square square ⍵}
 
@AlexB There are a bunch of synonyms, but I'm always interested in more, so whenever you search for something using some query, and then only find what you were looking for using another query, do let me know, and I'll add the appropriate keywords. array and matrix are probably a good idea.
 
@Adám OK, perfect. I will make a note of it and send you several, as soon as the opportunity arises.
 
5:02 PM
@Fmbalbuena Other than APLcart? No. Also, it seems a bit silly to use such long names when you can just write a*2 and a*4 no?
@AlexB Thanks. You can also open issues on GitHub. As you wish.
 
What are you trying to say?
 
I'm trying to write {2*⍵} in tacit
 
*∘2 or ×⍨
If you want to bind one argument to a function, you have to use the Bind operator,
 
5:08 PM
Dyalog APL doesn't let you use line breaks in parentheses to force line continuation.
 
@Fmbalbuena here
 
Maybe @Fmbalbuena wants to avoid counting f← in the code length.
 
@Adám yes, but with the definition in the header it doesn't seem to work.
 
imagine caring about loopholing the rules to don't count the function definition in
 
5:12 PM
I failed
to post
 
That's consensus on CGCC.
 
0
A: Remove odd indices and double the even indices

GrahamAPL+WIN, 15 bytes Prompts for string 2/(~2|⍳⍴m)/m←,⎕ Try it online! Thanks to Dyalog Classic

 
@Adám and you can just subtract 2 from the byte count
 
Subtracting 2 is hard, I guess.
 
understandable.
it's annoying for sure to do it each and every time you update your answer. but you usually also prepend a striked out old score, so i don't think it makes much of a difference
 
5:21 PM
You need to adjust the score anyway, due to UTF-8 vs SBCS…
 
oops, i never do it.
what's the point in competing against other languages anyway
you'll always be outgolfed by someone who's made a stacklang where the solution is a chain of builtins where each builtin would take four lines of APL to express
 
that's why things like code.golf are fun (but hard)
 
they're language locked. can't solve them in APL.
and the leaderboards are per language anyway.
the challenges aren't diverse and code.golf makes golfing more of a chore than enjoyment
 
yeah, no APL (at the moment), but per language + fairer
@KamilaSzewczyk the challenges are pretty diverse
 
last time i checked there was around 30 of them.
 
5:31 PM
there are 66 atm
 
 
4 hours later…
9:26 PM
@Adám The bounty made me to earn Mortarboard badge.
 
Good for you!
 
In Dyalog 18.0 I got a WS FULL message. Is there a way to clear space so that I can at least save my unsaved work? Any APL, user, or system commands fail to execute (the only reaction is that the line where I typed the command gets immediately cleared).
 
Try )erase nameOfSomethingBig
 
@Adám What if there is 999999 variables with 10 MB?
 
Start by erasing one, then do ⎕EX expressionThatGeneratesSomeNames
 
9:38 PM
That will be a waste of time
 
@Adám I have nothing big.
 
Are you using RIDE, by any chance?
@Fmbalbuena How so?
 
RIDE?
 
@Adám )erase does not work.
@Adám I am using the integrated app on the MacOS appliance :-)
 
@AlexB then you may remove a variable like f←''
 
9:40 PM
I think it's the same code as RIDE, but I didn't invoke RIDE separately.
 
@Fmbalbuena well then you shouldn't have created 999999 variables
 
I suspect RIDE isn't actually connected to the interpreter any more.
You can try Ctrl+F12 to see if the interpreter is even responding to RIDE.
 
I had a bug in a recursive function. AFAIK, no threads are running, so any dynamically allocated men should have been GC'ed.
 
@Adám ah yep that's what happens if executing things just clears the line
 
CMC: Implement a function that returns 1 if there is odd 1s (ternary numbers) else Anything (except one), the input is decimal.
 
9:42 PM
@AlexB Easy for me to say, but it is a really good idea to work with text source files so you can't lose your work.
@Fmbalbuena I'm not sure what you mean by "ternary". Could you give a few example cases?
 
Ha! it's spitting out lots of this stuff:
532161473 send ["UnknownCommand",{"name":"InvalidSyntax"}]
532161970 recv ["InvalidSyntax",{}]
532161973 send ["UnknownCommand",{"name":"InvalidSyntax"}]
532162459 recv ["InvalidSyntax",{}]
 
Aha, maybe it is just in a funny input state. Try to send an interrupt.
 
I hit CTRL-C a billion times, but it doesn't stop.
 
Action>Strong Interrupt
 
A ternary numeral system (also called base 3 or trinary) has three as its base. Analogous to a bit, a ternary digit is a trit (trinary digit). One trit is equivalent to log2 3 (about 1.58496) bits of information. Although ternary most often refers to a system in which the three digits are all non–negative numbers; specifically 0, 1, and 2, the adjective also lends its name to the balanced ternary system; comprising the digits −1, 0 and +1, used in comparison logic and ternary computers. == Comparison to other bases == Representations of integer numbers in ternary do not get uncomfortably lengthy...
 
9:44 PM
@Adám Yes, CTRL-C. I remapped it.
 
Oh.
 
I also tried through the menu.
 
I'm afraid I really don't know what to do then :-(
 
It's OK. I will kill everything and restart from scratch. I didn't have hours and hours of work.
 
You may be able to salvage some things from the session log. You can still scroll and copy from it…
Again, I recommend text files, but it is also easy to implement autosave
 
9:47 PM
I had to "Force Quit". Normal Quit wouldn't work.
I also noticed that Dyalog traps "Force Quit" and asks for confirmation. It shouldn't trap it, AFAIK, except possibly to dump to a file.
@Adám Yes, I was planning to use ext. files. I am waiting for 18.2 with full sync on the Mac... :-)
 
And I'm partially to blame for its delay ⍨
 
can confirm that f ← { \n 1+∇⍵ \n } and running f 2 does very funky things
 
Funky things that don't happen with f←{1+∇⍵} ⋄ f 2?
 
because ⎕SI whatever presumably
 
Surely, ⎕SI isn't to blame. You're building up a stack since this cannot use TCO.
 
9:51 PM
@Adám ha ha don't be hard on yourself. You do so many things!
 
but the stack must be held around after the WS FULL, whereas without the newlines it can be freed
 
Ah, I see.
 
a←1 ⋄ {a⊢←1a}⍣{0}0 does the same glitchiness
 
Some people do spare←1e6⍴.1 ⋄ ⎕TRAP←1 'C' '⎕EX''#.spare'''
 
there's not really much dyalog could really do here though, besides making sure everything needed to execute )erase whatever and )sic never allocates anything at all
@dzaima (which, incidentally, sounds like a fun thing to work on in CBQN)
 
10:03 PM
Adám would it be a bad idea for x < y to be equivalent to ⍪x y when x & y are scalars
 
@FawnLocke Yes, e.g. in the case 3 < 4 which currently gives 1 and not 2 1⍴3 4
 
Ah, right, of course
< is proposed for the monadic case haha, dunno why I overlooked that
 
The dyadic form of "add leading axis" would of course be "combine with a leading axis", as it is in BQN.
 
Okay, cool
 
I.e ↑⍤,⍥⊂ is exactly that.
 
10:08 PM
@Fmbalbuena Unfortunate I couldn't get 2/⊢/⍤⊢⌺(⍪2 2) slightly shorter
 
Unfortunately, ⍪⍤< wouldn't be that because monadic is silly.
 
How so? I haven't read into it's documentation so /shrug
I'll do that now
 
Monadic is ,⍤¯1
 
Oh, I see
 
… which is almost never what you need.
 
10:10 PM
yeah, that is bee
 
I suspect that the most common use case for monadic is ⍉⍪vector to… add a leading axis.
I'd be really interesting to have statistics on usage of primitives that included valence.
 
10:40 PM
@FawnLocke ⊢/⍤⊢ can be ⊃∘⌽ with ⎕IO←1
 
Heh, I posted that in the esolangs server at the same time you pinged me
 
I came up with it earlier but was too lazy to post until now :P
 
Ninja'd
 
still longer than the tacit anyway
 
⊢⊢⍤/⍨0 2⍴⍨≢ this solution is shorter
yeah
Which is a shame
 
10:51 PM
Implict output in APL?
 
With Dyalog 18.0 on MacOS, I can trace execution but:
1. I don't seem to be able to single-step one function at the time (it executes one whole line at the time)
2. I cannot find a way to set breakpoints
3. I cannot find a way to display values of variables

What am I doing wrong?
 
1. you can't; 3. you can see the variables in the REPL
2. you click on the very left of a line, or ctrl+numpad plus (or whatever "Toggle breakpoint" is)
 
@dzaima even alpha and omega?
 
@AlexB yep
 
@dzaima thanks. I will look better. It’s not the same as other IDEs…
2. I found where to click to set a breakpoint. There is no visible affordance. Only the cursor changes slightly when it's over a strip that's just a few pixels wide. If you blink, you miss it. (Perhaps something to improve?)
 
11:05 PM
@BgilMidol Not sure what you're asking. Can you rephrase?
@Bedstorm Hi there. Interested in APL?
 
Also another problem:
4. In a recursive function, there seems to be no way to print as I single-step through it. The output seems to be buffered because it appears all at the same time when the top-level function returns...
 
@Adám I have an expression (e. g 99*99) and I want the result to print implicitly
 
In the interactive session? (REPL)
@AlexB That doesn't sound right. Are you using ⎕← or ⍞←?
@AlexB 3. you should also be able to hover mouse over name to see value tip.
And double-click or Shift+Enter should open name in window to inspect value.
 
@AlexB You probably want to ⎕← before the recursion happens
 
@Adám no, you are right, I am only returning a value; I wanted to monitor the array as it is being built — it's not a problem of buffered output.
@Adám It's very unstable. If you didn't tell me I would never find it. The cursor has an I-beam shape and it's sensitive over just a few pixels when hovering on a variable. The UI is a bit quirky. Getting tips from the experts is helping a lot.
 
11:12 PM
@AlexB Please do log such issues against RIDE.
 
I was able to double-click on ⍵, which opened another tab with the value of ⍵. Then I was able to drag it on the side to view the source code and the value of ⍵ at the same time. However when it recursed down the trace window got reset, it jumped in a different position on the screen, and the ⍵ panel disappeared.
@Adám I will.
 
@AlexB Yeah, dfns do this because it is a new scope. Tradfns tend to be much nicer to observe. One feature I'd like, is the ability to open a window on a name, displaying at all times whatever the value is of that name.
 
@Adám I understand that I am entering a new frame, hence a new scope, however it would be logical to keep the monitors on the local vars having the same name in the new scope, especially ⍺ and ⍵. (That is normally what debuggers do.)
 
Isn't that what I described?
 
@Adám you explained why it doesn't do what I need it to do :-)
 
11:20 PM
> One feature I'd like…
 
@Adám I thought you weren't referring to local vars. Now I understand you were saying the same thing. (I thought that by name you meant a bound variable.)
Anyway, yeah... we need this!
 
@AlexB that become pretty bad if you don't call precisely yourself - all your monitors would now be broken upon entering another function
 
@AlexB That wouldn't be a RIDE issue though, but a new interpreter feature (don't forget that RIDE is "dumb" and has no clue what the significance of various windows are; the interpreter controls which windows are open and when they close). Feel free to email support@
 
@Adám but RIDE would need features to be able to open that new style of monitor
 
Only a keyboard shortcut, GUI button, etc., no?
 
11:27 PM
well yeah
 
11:41 PM
@Adám I logged 3 issues on RIDE. If they should be on the interpreter instead, please move them. TBH, from a user's viewpoint (especially on the Mac) it is the debugger UI that is involved. Whether it's a RIDE or an interpreter problem is up to the development team to judge, because I wouldn't know for sure.
 
(I get notifications.) Yes, and we will move issues if necessary. Don't worry about it.
 

« first day (1819 days earlier)      last day (819 days later) »