« first day (1290 days earlier)      last day (48 days later) » 

12:00 AM
:If 1=≢AplInput
AplInput←⊃AplInput
:EndIf
>_>
 
@TessellatingHeckler ⊃⍣(1=≢AplInput)⊢ AplInput
 
@dzaima isn't that going to infinite loop if the input is ⍎ + 4 like my example?
 
@TessellatingHeckler No, it only runs 0 or 1 times, since the right operand evaluates to a number, which is the count of iteration.
 
@TessellatingHeckler there is getting a number argument, which is "repeat n times" (which is completely distinct in behavior to "until" which has a function right operand)
 
is my problem that I missed ⊢ from my code?
⊃⍣(1=≢)⊢⊂1
no, that infinite loops
 
12:04 AM
@TessellatingHeckler again, s right operand there is a function. We want a number right operand
 
right, the problem is not having the evariable in the parens right of power
ok
 
@TessellatingHeckler yeah, we can't get around needing to write the name twice unfortunately
 
Or maybe wrap it into {⊃⍣(1=≢⍵)⊢⍵}AplInput
 
@Bubbler probably worth making that a named function, as it'd be needed for both the right and left argument
 
Or {1=≢⍵:⊃⍵⋄⍵}AplInput
@dzaima Yes, or you can always it.
 
12:07 AM
@Bubbler well, the left operand might be non-existent, which doesn't really work in APL
 
@dzaima This is working pretty nicely!
@Bubbler I think that symbol is 18.0 only?
 
Yes.
 
ah, this is 17.1 still
 
You can still name the dfn and reuse for both args, as dzaima suggested
 
12:29 AM
the biggest problem now is, why don't complex objects go through the bridge properly? Are they actually being serialised and if not, what else?
 
Huh, how are you treating ?3⍴? It is not a proper function.
 
@Bubbler "?3⍴" makes a powershell string, the space breaks the powershell string so it becomes a right argument, a temp variable Y gets 0, then the code becomes '?3⍴ Y' sent into APL's ⍎
that means it works to do

PS C:\> $val = 0
PS C:\> ⍎ ?3⍴ $val
 
That makes sense, though I was expecting it to evaluate (?3⍴) 0 rather than ?3⍴ 0
 
@Bubbler ok, would it be more clear as ⍎ "{?3⍴⍵}" 0 ?
the fact that you can leave off quotes and braces sometimes is an implementation detail of the way it uses ⍎ internally with a string
 
12:45 AM
@TessellatingHeckler It's better for me, but it's just my preference. Yours matches with the bare APL expression as written after all.
 
@Bubbler fair enough
the last example with ⎕NEW DateTime? I know it can find PSVariable, and it must be possible to ⎕NEW that, but everything I try is a domain error.
  PS C:\> ⍎ ⎕a
  ABCDEFGHIJKLMNOPQRSTUVWXYZ
shortest way to get an alphabet in PS
 
@TessellatingHeckler Maybe inspect what you get inside APL using and ?
 
1:01 AM
I don't get anything; I try

PS C:\> ⍎ PSVariable

IsPublic IsSerial Name BaseType
-------- -------- ---- --------
True False PSVariable System.Object
this proves it can resolve the name to System.Management.Automation.PSVariable. Then I try

PS C:\> ⍎ "⎕NEW PSVariable ⊂'test'"
⍎ : Function "EndProcessing" caused a "DOMAIN ERROR" on line 13
there is a constructor which takes a String. Try with variant:

PS C:\> ⍎ "⎕NEW (PSVariable⍠String) ⊂'test'"
⍎ : Function "EndProcessing" caused a "DOMAIN ERROR" on line 13
I've tried a guesswork of putting parens here there and everywhere, using other constructors (String, Object)
oh man
⎕NEW PSVariable (⊂'hi') works
how is that different from ⎕NEW PSVariable ⊂'hi' ?
 
@TessellatingHeckler I guess PSVariable is an "array", so syntactically there is evaluated as dyadic? That makes a huge difference though.
 
@Bubbler ahhhhh, like anyvar⊂'hi'
 
1:25 AM
I'm varianting the wrong thing
 
1:36 AM
ha ha, one day, one day. Trying to make everything ⊂'chars' thinking that's how to make a string, is causing all my problems
PS C:\> $test

PS C:\> ⍎ "SessionState.PSVariable.Set 'test' 4 ⋄ 0"
0

PS C:\> $test
4
a non-existant powershell variable, set to a value from inside APL
  PS C:\> ⍎ "(SessionState.PSVariable.Get ⊂'test').Value"
  4
and reach out to the surrounding powershell session state and get the $test variable
that needs ⊂'test' otherwise it's trying to be Get('t', 'e', 's', 't'), yeah ok
 
2:25 AM
whew. I now sort of understand why my directory objects don't work the same way, can run PS from APL, and have the commandlet set some debugging variables in the surrounding session
(Sorry for spamming this room with so much stuff that isn't directly APL, but I'm very happy with this progress, and grateful for the help :) )
 
 
3 hours later…
5:08 AM
@RGS nice to see many array-oriented solutions for Weights, i gave in and stuck with a recursive solution
 
 
1 hour later…
RGS
6:10 AM
@user41805 yeah, getting to an array oriented solution for the last problem consumed a lot of brain power for me :p
 
RGS
6:30 AM
Does anyone know if Dyalog APL will force multiple assignments to require () on the left?
 
@RGS I certainly hope so...
But I imagine they have backwards compatibility commitments
 
RGS
@Moonchild D:
 
It's kind of a mess right now. a b c d←x can mean 4 different things, depending on what a, b, c, and d are
 
RGS
7:12 AM
@Moonchild So with fresh A, B, A B ← 1 just does multiple assignment. If B ← + then A B ← 1 attempts to do modified assignment; if A and C are 1 and B is +, then A B C ← 5 assigns 5 to C and returns 6; what is the 4th thing?
 
oh, there are more even...
I was thinking of: if d is fn; if c is fn and d is m-op; if b,d are fn and c is d-op
so a b c (d←) x; a b (c d←) x; a (b c d←) x; (a b c d) ← x
 
RGS
oh wow
 
Well, you can build the function-modifying chain without bound, so e.g. if b←+ and c←¨, then a b c c c c c ... c←1 would be valid
 
@Bubbler let's pretend I covered that with a (b c d←) x :)
but yes, the whole thing is a mess. I'm not entirely sure I agree with bqn's removal of all syntactic ambiguity, but I definitely don't agree with how ambiguous modified|multiple assignment is
 
@RGS Yes.
@TessellatingHeckler Ravel simply reshapes to a vector. It is equivalent to ×/⍤⍴⍴⊢. Enlist destroys all structure to create a simple vector. Materialise converts .NET collections to arrays of objects (similar to [...x] in JS) and gets the default property if one exists.
@TessellatingHeckler I think ⊆⍣¯1 works.
 
7:37 AM
@Adám So... is it "disclose if it is a nested scalar of depth 2"?
 
@Bubbler I think so. It isn't documented.
@TessellatingHeckler I, for one, am very happy to follow your progress.
@RGS We're considering disallowing multiple assignment without parens in the new array notation.
@Moonchild We have a standing suggestion to allow your syntax to disambiguate.
@Moonchild Yeah, that was a bad mistake by Dyalog. The other major APLs don't allow it.
 
@Adám neat; what is it?
 
8:00 AM
@Moonchild a(b←)c disambiguates that a is the name of an existing array, and b is a function.
 
RGS
@Adám I see; does that mean "when we introduce the new array notation multiple assignment without () will be disallowed" or do you mean only with the new notation it will not be allowed?
 
@RGS Only in the new notation. Dyalog is committed to backwards compatibility.
 
@Adám oh, I see; I misunderstood your original comment
@Adám has any thought been given to making a clean compat break, and supporting two apls in parallel (but only continuing development of one)?
 
RGS
@Adám ah!!!, Dyalog pledged that it will never introduce backwards incompatible changes, or something like that?
 
@RGS that's true of most mature programming languages. C, c++, python, shell, perl, js...
 
8:05 AM
@Moonchild Yes. Unfortunately, Dyalog got burned last time, and so is very reluctant to try again. I kind-of have a suggestion for trying again.
 
RGS
8:42 AM
@Adám but wasn't Dyalog burned because it relied on something else? Making something like APL' wouldn't be subject to the same burns, would it?
 
9:03 AM
@RGS True, that's my point, but the feelings linger.
 
RGS
Yes, I understand; but I thought APL' was simply a toy project of your own. Have you taken it up to Dyalog/intend to?
 
ngn
9:19 AM
@Moonchild by convention it's ok to break backwards compatibility between major versions. but not in dyalog.
 
9:31 AM
@ngn Depends on language. Of the languages I mentioned, only python and perl have ever broken compatibility. Python isn't likely to ever do so again, and perl5 is planned to be maintained indefinitely
 
ngn
@Moonchild js has "use strict"
 
Perl 6 is no longer even Perl :/
 
@ngn fair enough. Still not a very a common occurance
@Bubbler and that seems to happen more frequently: version 'n+1' of a language is just a completely different language. Same thing happened with d1 and d2
 
ngn
@ngn .. and "use strict" was an idea borrowed from perl
 
⋄3 3⍴⍳9
 
9:40 AM
1 2 3
4 5 6
7 8 9
<moon-child> hallo from irc!
 
RGS
@DyalogAPL nice
⋄?10⍴10
 
so it crashed, apparently. Seems to do that intermittently, for reasons unknown
 
RGS
@Moonchild oh ok :/ when it crashes what has to be done?
 
oh, no, I just made a dumb mistake
 
Oh, so that's the bot mentioned earlier (with code runner and IRC relay), right?
 
9:42 AM
⋄?10⍴10
 
@Moonchild 7 8 8 8 3 1 7 10 6 7
 
@Bubbler yes
 
<moon-child> ⋄10 2⍴5
 
RGS
@Moonchild very cool; is the code for the bot available?
 
⋄≠'Mississippi'
 
@Bubbler 1 1 1 0 0 0 0 0 1 0 0
 
So it's indeed running Dyalog 18.0
 
yep
(I'm not particularly proud of that hack)
 
RGS
really cool; what happens if one (un)intentionally runs a really heavy command?
 
9:46 AM
Does it support code-formatted code (either backticks or 4 spaces indent)?
 
@RGS @Adám's safe executor takes care of that
@Bubbler not atm
 
RGS
@Moonchild nice o/
 
\o
 
RGS
⋄⍳30⍴30
what is the timeout you set? and what if the output is large, will it print everything?
 
That doesn't run even in regular environment, it causes a LIMIT ERROR.
(since the rank would exceed Dyalog's limit of 16)
 
RGS
9:49 AM
@Bubbler I'd expect the bot to report errors as well
 
@RGS Default timeout is 10s; I didn't see fit to change it. If the output is large, it gets pastebinned
⋄10 10⍴⍳100
 
⋄⍳30⍴30
 
@Moonchild LIMIT ERROR
 
there we go
 
RGS
9:50 AM
@Moonchild :D
⋄⍳(29+1)⍴30
 
@RGS LIMIT ERROR
 
⋄{∇ ⍵} 0
 
@Moonchild Execution timed out
 
⋄+/1 2 3 ⍝ Trying a comment
 
@Bubbler 6
 
9:53 AM
⋄ 5⋄6 ⍝separators work as you would expect
 
@Moonchild 6
 
⋄s←'Hello World!'⋄2/s
 
:55179953
 
Wat.
 
ngn
@Bubbler /s might mean something in irc
 
9:55 AM
that I'm not entirely sure. 55179953 is the ID of your message, but the output seems to have been truncated somehow
 
⋄s←'Hello World!'⋄2⌿s
 
:55179964
 
No, it's not something with slash.
 
ngn
my theory has been shot down :)
 
⋄s←1 2 3⋄s+4 5 6
 
9:56 AM
:55179972
 
⋄⊢s←1 2 3⋄s+4 5 6
 
@Bubbler 5 7 9
 
It happens when the first expression is shy.
⋄⊢s←'Hello World!'⋄2/s
 
@Bubbler HHeelllloo WWoorrlldd!!
 
⋄⎕←s←'Hello World!'⋄2/s
 
9:58 AM
@Bubbler HHeelllloo WWoorrlldd!!
 
I think it needs to output everything it is meant to.
 
@Bubbler seems to be a bug in @Adám's safe executor
@Bubbler actually seems to happen when any part of the expression is shy. For now I think I'll just make it print all expressions, even shy ones; there's not much point in asking a bot to evaluate something without seeing the result
⋄s←'hello world'⋄2/s
hmmm. Not sure why that didn't work, but I'm off to bed now. Will take another look tomorrow
 
⋄⎕←'this',⍥⊂'that'
 
⋄'this',⍥⊂'that'
 
@Moonchild It is supposed to be given one expression at a time.
 
10:12 AM
⋄'this',⍥⊂'that'
 
@Moonchild this that
 
@Moonchild It should put 4 spaces before each output line
 
RGS
⋄1 (2 3 (4 5) 6 (7 (8 (9 10))))
 
@RGS 1 2 3 4 5 6 7 8 9 10
 
@Adám how should people handle multiline expressions, then? Splitting on doesn't work because variables don't persist
@Adám it does, but that apparently doesn't work when there's only a single line of output. Fixed to use ``` in that case
⋄1 (2 3 (4 5) 6 (7 (8 (9 10))))
 
10:18 AM
@Moonchild 1 2 3 4 5 6 7 8 9 10
 
RGS
10:33 AM
In what "traditional" programming languages does one index with () instead of []? I can only think of Matlab :P I've read twice now that "APL uses [] to index as opposed to (), which is what many programming languages use"
@RGS some old programming languages like cobol and fortran, e.g., or things like scala, matlab and visual basic
 
<kritixilithos> ⋄⍳10
1 2 3 4 5 6 7 8 9 10
<kritixilithos> nice
 
RGS
@Moonchild might be interesting to have the username in the message that is cross-posted to have a direct link to the original message
I have no idea if IRC messages have a permalink, but at least in the other direction should be possible.
 
11:13 AM
@Moonchild The executor can take a persistent namespace.
@Moonchild This works fine:
here be dragons
⋄'test'
 
@Adám test
 
⋄'test'
⋄'test2'
@Moonchild The bot should handle backticked and leading spaces.
 
 
3 hours later…
1:51 PM
<kritixilithos> btw, codidact released a software development site software.codidact.com/questions/277141, so there's another place for apl questions
 
@kritixilithos Ooh, I'll have a look.
 
 
3 hours later…
4:39 PM
it can now take pipeline input, which means it can be used as a bit of a filter
and chained, which means things like ls |⍎ 2 ↑|⍎ ⌽ to take those two and reverse their order
 
RGS
@TessellatingHeckler so your powershell now runs apl code?
 
@RGS my powershell can pass PS data and a code string into Dyalog APL, which runs the code against the data, and hands the results back out to PS
or optionally just run a line of APL and return the results to PS
 
 
4 hours later…
8:37 PM
<jcowan> RGS: Fortran comes to mind.
<jcowan> you write a(i) for an array element just as you write foo(a, b) for a function call.
<jcowan> I would guess that [] appeared first in Algol 58, though exactly what the pathway was to Iverson I can't guess.
 
...not to mention k (or should I let ngn jump on this one?) In k, you can use [] for indexing, but you can also just apply arrays to arguments, same as functions. So (5 6 7) 1 ←→ 6
 
9:03 PM
<jcowan> in the oldest Lisps that was the only way to index an array: call it as a function.
 
@Moonchild in k x[y], x y and x@y are all (mostly?) the same thing, and all can be used to either index an array or call a function
 
9:33 PM
bot updates: multiline code (with separators or four-space prefixed) is recognized correctly, as is backtick-fenced code. Shy results behave appropriately. And for IRC, html is automatically stripped (but links are preserved), so output should be prettier
x←5
⍳x
 
@Moonchild 0 1 2 3 4
<moon-child> jcowan: neat, I didn't know that
<moon-child> (for some reason, I assumed that vectors were ~relatively~ recent addition to lisp, and aref/elt showed up at around the same time)
 
@RGS IRC is decentralized(-ish) and not persistent. So there is no 'original message'. You send your message to the server, the server sends it to all the other clients, and then it's gone from the server. Other way—I am considering putting the SE message IDs in the IRC messages, but I think it wouldn't be that useful and act as visual clutter. (IRC doesn't have markup for anything other than colour.)
 
<jcowan> Persistence takes the form of people who run logging bots.
 
Persistence takes the form of people still using IRC in 2020 ;)
(I still have a weechat / tmux session handy)
 
znc for the win!
 
9:46 PM
Recognise it as a bouncer(?) but never used it
 
<moon-child> TessellatingHeckler: yes, IRC bouncer. (Actually, I run weechat in screen connecting to a znc on the same host, but in principle I could run the IRC client locally and get most of the same benefits.)
 
10:03 PM
<klg> Probably the most feature-full bouncer. I used to use it with various graphical clients, but stopped one day when I realized I'm just running irssi under screen on the same host and the only thing znc gives me is more ways to fail
 
 
2 hours later…
11:54 PM
bit weird behaviour with the .net bridge and data types
Trying to make these two behave identically:

⍎ "{+/⍵}" (1,2,3)
(1,2,3) | ⍎ "{+/⍵}"
They both turn into the charvec '{+/⍵} Y' and in the first, Y is a variable of the disclosed powershell data, (maybe materialised?) and it works. The second is an APL array of the pipeline items one at a time ... and throws a DOMAIN ERROR.
I guess the int32s are being boxed to System.Object, but if I do ≢⍵ it is 3, ⊃⍵ is 1, ⍵[1 2 3] gets three numbers which come out as int32
gotta read up on trapping errors and finding the longer error message somehow
 

« first day (1290 days earlier)      last day (48 days later) »