« first day (1777 days earlier)      last day (864 days later) » 

But do these tables bring anything over what's on APL Wiki?
 
Will, do. Yeah
 
How so?
You won't be able to keep up grouping them in fours.
 
I'm just experimenting atm. Also, I was aiming for something very similar to NuVoc using the APLWiki and Dyalog's docs as sources
A good handful of the primitives don't have explanations on the apl wiki, I'll probably have to write some myself as a result
 
APL Wiki one links to APL Wiki article of each functionality. The one in Dyalog docs will link to Dyalog doc pages, which precisely contains Dyalog's behavior and nothing else
 
12:17 AM
@FawnLocke An attempt at groups of four:
+-×÷
*⍟⌈⌊
|○!?
=≠≡≢
<≤≥>
∧∨⍲⍱
↑↓⌷⍴
⊂⊃⊣⊢
⊆∪∩~
⍳⍸∊⍷
/\⌿⍀
⌽⊖,⍪
⍉⊥⊤⌹
⍎⍕[]
(){}
¨⍨⌸⌶
⍣@⌺&
.∘⍤⍥
←⋄→⍝
¯⍬⎕⍞
⍺ ⍺⍺ ⍵ ⍵⍵
∇ ∇∇ # ##
 
That's nice. I'll use that. I was gonna create a separate table of odd shapes but this is better
 
I guess [] and {} can occupy single cell each, and () can be omitted (like how J NuVoc does)
 
]ucmds and )syscmds
There's maybe missing ' or ''
And : (which has three uses)
And ; (which has two/three uses)
@Bubbler Logged as 19542
 
' can be omitted too
An additional last row could be ]ucmd )syscmd : ;
 
12:33 AM
@Adám elif and else?
 
@Fmbalbuena :ElseIf and :Else
 
@Adám ok
label syntaxerror
L:
raises error
@Adám ^^^^^
 
Well, you'd need to show a bit more of your code.
 
starting to learn apl by learning about tradfns is a terrible idea
 
12:37 AM
tradfns?
 
@Fmbalbuena You need to wrap your code in ∇FunctionName
 
rather than try and write APL like you'd write any other language, try and learn how to write APL like it's APL
 
@Adám oh i forgot
call function?
 
@Fmbalbuena Just its name.
 
@Adám i don't understand.
 
12:39 AM
 
@Fmbalbuena TIO uses an old version. You can use 0∘(819⌶) instead of ¯1∘⎕C
 
@Adám new interpreter for Non-REPL APL
 
Or install Dyalog APL locally
 
@Fmbalbuena I recommend that ^
 
12:42 AM
but i don't know how to execute non-repl APL.
 
@Fmbalbuena You just enter the code as on TIO, then enter F to run it.
 
^ no need to use tradfns
@Adám no, they mean locally
 
@rak1507 Now try doing multiple things for one command…
@rak1507 Yes, that's it.
@Fmbalbuena I'd avoid gotos:
∇MyFunction;f
:Repeat
  f←¯1∘⎕C ⍞
  :Select f
  :Case '/help'
    ⎕←'The help command does so and the command and /exit exits the program'
  :Case '/exit'
    :Leave
  :Else
    ⎕←'use /help'
  :EndSelect
:EndRepeat
∇
Notice also ;f in the header which declares f as a local name.
 
ok sorry but i wanted to make the code more golfy
 
@Adám help←{...} ⋄ exit←{...} ⋄ cmds←'help' 'exit' ... ⋄ main←{cmd←⍞⋄cmd∊cmds:(⍎cmd)⍬⋄∇⎕←'invalid command please try again'} or something
 
12:45 AM
@Fmbalbuena Then you want to do what rak1507 wrote with the dfn.
 
(or just use guards not exec if you don't like exec)
 
Try it online! what happened?
 
@rak1507 Sure, but it is not fun to debug or maintain. Oh well, to each their own.
 
Dyalog APL/S-64 Version 17.1.36845 Classic
For i86_64
Created: Aug 15 2019 at 00:27:20
Copyright (c) Dyalog Limited 1982-2019
      ⎕PW←32767
      ⎕TRAP←0 'E' '⍞←⎕DMX.(↑DM,¨'''' '''',⍨⊂Message,⍨'': ''/⍨×≢Message) ⋄ ⎕OFF(128⌊⎕EN)'
      '#'⎕NS⎕FIX'file:///home/runner/.bin.tio.dyalog'
/help
help
/exit
line(14,0) : error AC0008: error (VALUE ERROR) executing line "F"
                                                               ^
Complete: 1 error.
DOMAIN ERROR: There were errors processing the script
 
@Fmbalbuena No need to dump that here.
@Fmbalbuena You moved F from Input to Code. Note that TIO's APL is also using a REPL, and Input is simply what you'd type into the REPL.
If you used a full installed REPL, you'd get much better error messages too. Plus interactive debugging.
 
12:49 AM
VALUE ERROR: Undefined name: /help
 
that's bc it exits when you do /exit and then tries to evaluate the next line(s) /help as APL
 
But I'm a bit surprised it includes / there.
 
@Adám wdym?
 
it doesn't
 
@Fmbalbuena Do you have a TIO link for that last VALUE ERROR?
 
12:51 AM
@Adám uhhh
can i post to CGCC tips?
 
@Adám Must be this
 
Oh, OK. No issues then.
@Fmbalbuena You don't have to ask for permission to post on CGCC.
 
@Fmbalbuena But what tip?
 
Yeah, I'm curious too.
 
@Bubbler For golfing APL code.
 
12:53 AM
Yeah, what's the idea you have?
 
Post?
 
You can post anything but if it is not a proper tip for golfing in APL then it'll be deleted
 
@Fmbalbuena Don't worry, we won't steal your idea. Feel free to write what it is here in chat, and we might be able to help you make it even better!
 
ok so i'm posting but i have to do so i post and gtg.
 
0
Q: Dyalog APL - Read from .txt file

erbsenhexleri'm new to dyalog APL and i'm struggling to read some input from an .txt file under Windows 10. The input data has the format: number name newline I want to store every line as an array element and in theory the input←⎕NGET 'input.txt' 1 function i'm using should work just fine. According to the...

 
12:58 AM
@Fmbalbuena If you have to leave now, I recommend not posting until you have time to hang around and follow up on any immediate feedback.
 
@Adám ok
Memory:
[APL (Dyalog Classic)], 168 bytes

<!-- language-all: lang-apl -->

    ∇F
    L:
    f←0∘(819⌶)⍞
    :If'/help'≡f
    ⎕←'The help command does so and the command and /exit exits the program'
    :Elseif'/exit'≡f
    :GoTo E
    :Else
    ⎕←'use /help'
    :EndIf
    :GoTo L
    E:
    ∇

[Try it online!][TIO-kwve3n7j]

[APL (Dyalog Classic)]: dyalog.com
[TIO-kwve3n7j]: tio.run/…
sorry for big message
 
It is not a golfing tip
 
Maybe they want help golfing it?
 
@Adám Confirmed then.
 
1:09 AM
ok but short time
 
Understood.
 
is possible to shorten?
 
28 mins ago, by rak1507
user image
 
Actual result:
∇F
L:
f←¯1∘⎕C⍞
:If'/help'≡f
⎕←'The help command does so and the command and /exit exits the program'
:Elseif'/exit'≡f
:GoTo E
:Else
⎕←'use /help'
:EndIf
:GoTo L
E:
∇
@Adám idk
 
You don't know?
 
1:11 AM
But how?
 
Not sure why he posted an image, but you should be able to read his code, no?
 
@Adám i can read but has a lot of unknown commands
 
Not sure which "commands" are unknown to you, but extensive documentation exists.
 
unknown commands: {}[Diamond][---0--- like]
i can't find from this
@Adám ^^
 
{} is an anonymous function called a dfn.
 
1:20 AM
ok and diamond?
and 0 like?
 
I was able to find them on that language bar, and took screenshots of them, which I posted above.
But you know, if you use a full installed system, you can press F1 on them to go straight to their documentation.
 
@Adám i't opens google help
 
@Fmbalbuena I suspect you pressed F1 in your browser rather than from inside an installed APL REPL.
 
@Adám sorry i't don't opens documentation.
 
@Fmbalbuena OK, then you can use the bot: ⋄]help ⍬
 
Well, that actually worked :-)
 
⋄]help ⋄
 
Ouch.
 
what happened?
 
1:25 AM
Bug.
 
@Fmbalbuena ((⊢+*)⌿↑∘(⍳,⍥⊂⍴⍨)) is how I'd write that in APL btw. Which can be golfed
 
nope i't don't compress strings or decompress
 
@StackExchangeFeeds Should I add these to APLcart?
Cv⎕NPUT⍨∘⊂D
(⊃∘⎕NGET 1,⍨⊂)D
(⊃⎕NGET)D
 
ok sorry
i have to really gtg.
⋄/
 
@Fmbalbuena /
 
1:35 AM
What's the nicest way to write ⍳⍵-1 as a single carriage? I have ⍳⍤+⍨∘¯1 so far
 
@Fmbalbuena For your information, this bug is logged as issue 19054. I'll get back to you when it is fixed.
@FawnLocke ⍳⍤-∘1
 
Thanks. That one escaped me
 
adr
2:12 AM
Hey there again. Reworked my solution (not the most beautiful code) https://git.sr.ht/~adregan/advent-of-code-2021/tree/mainline/item/6.apl

However, the large numbers are coming out like so `1.693022482E12`. Is there any way to avoid that?
 
@adr ⎕←0⍕1.693022482E12
 
@Adám
 1693022482000
 
Note the leading space, so you may want to add 1↓ in front of that.
@adr {c←9⍴0 ⋄ c[⍵] ← 1 ⋄ c} is {~@⍵⊢9⍴0}
@adr state[⍳7] ← 1⌽⍵[⍳7] is state[⍳7] ⌽⍨← 1
@adr Since you only use new once, you might as well inline ⍵[0] into state[8] ← new giving state[8] ← ⍵[0] which'll line up nicely too.
@adr state[6] ← state[6] + ⍵[7] is state[6] +← ⍵[7]
 
adr
Thanks! I'll play around with that.
 
adr
2:31 AM
The thorn was the ticket. It'll take me some time to digest those other suggestions; looking forward to it.
 
Hi, I'm proxying POST requests to a Dyalog Conga server and I'm getting this error message: Unable to Send for client SRV00000000.CON00000002 (1008): ERR_INVALID_OBJECT
Does anyone know what could cause this?
 
@phantomics I'll ask Brian or Bjørn, but it'll be a few hours…
 
3:04 AM
@Adám Thanks
 
 
2 hours later…
5:09 AM
0
Q: Historic APL glyphs and their meanings

ᅙᄉᅙUnicode has the following APL characters that don't seem to be used in modern APL. What functions or operators did they represent? Are they still supported for backwards compatibility, but undocumented? I have also seen some of these in code that's no longer in use. Quad circle ⌼ Del tilde ⍫ Qua...

 
5:29 AM
@StackExchangeFeeds Does anyone know? ⍙ can be used in symbols but did any of the others there have a traditional use? I figure they might have loaded all possible combinations of some characters into Unicode regardless of their use.
There's a bunch of stuff the question didn't mention as well, like ⍇⍡⍛⍘
 
 
3 hours later…
8:47 AM
@phantomics INVALID_OBJECT usually means that you're attempting some invalid action on an object
Are you trying to do an i.Send 'SRV00000000.CON00000002' (somedata)? Is it a custom server or Jarvis?
@phantomics What mode are you using, HTTP or raw?
 
@Adám issue in github or What?
 
@Fmbalbuena No, our internal issue tracker.
 
@Adám link
 
9:03 AM
> internal
 
internal?
ok
Array/List/Tuple in APL?
 
all the same
 
@rak1507 Array = List ≠ Tuple ≠ Array
 
there are no tuples in apl
 
9:08 AM
And lists are just 1-dimensional arrays.
 
array syntax?
 
Golfy, but part 2 is slow doing the brute force thing.
 
@Fmbalbuena 10 20 30 makes a 3-element vector.
 
faster if you use n*(n+1)/2 for triangular nums
 
@Adám ok but 2d array is possible?
 
9:15 AM
@Fmbalbuena Only through function application: height width⍴data
(We're working on a proper multi-dimensional array notation.)
 
ok but how many commands there are in APL?
 
Depends on what exactly you count as "a command".
E.g. is - one or two "commands"? 10-2 and -2
 
A command in APL dyalog classic
 
That doesn't help. And Classic is identical to Unicode (which you should use!) when it comes to vocabulary.
APL has functions (which can often be used in two distinct ways) and operators (which sometimes have multiple more-or-less related, and sometimes unrelated, meanings too). In addition, there are system functions and operators and constants. System and user commands, control structures and other keywords, and various special syntax.
 
@rak1507 holy cold smoke, Batman - that's a lot faster...
Never heard of a triangular number.
 
9:26 AM
+/⍳n                 ⍝ ⎕IO←1 based
2÷⍨+/(⌽⍳n)+⍳n        ⍝ adding itself
2÷⍨+/((n+1)-⍳n)+⍳n   ⍝ ⌽⍳n is (n+1)-⍳n
2÷⍨+/n/n+1          ⍝ ⍳n cancels leaving n copies of n+1
2÷⍨n×n+1            ⍝ formula for nth triangular num
 
@rak1507 Maybe I should add 2÷⍨n×n+1 to APLcart with +/⍳ as keyword?
 
yeah, maybe
 
Funky: ⊥∘.5 .5 0
 
@Bubbler Huh, that looks wrong, but should just work.
 
hmm yes, outer product with the function 5 applied to ⊥ and .5 0
 
9:31 AM
 
@Adám oh really!
how is it going to work?
 
@rak1507 Apparently this is known as "Gauss' summation formula"
      ]runtime -c "xpqz¨t" "rak1507 t"
┌→──────────────────────────────────────────────────────────────────────┐
↓                                                                       │
│  xpqz¨t     → 3.4E0  |    0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕ │
│  rak1507 t → 1.6E¯2  | -100%                                          │
└───────────────────────────────────────────────────────────────────────┘
I'll steal your idea.
 
9:58 AM
@xpqz good idea :P
 
@Adám so how would say, 2 2pi4 would be represented? (ignore that i used p for rho and i for iota, currently on a phone)
 
[1 2
 3 4]
or [1 2 ⋄ 3 4]
You can also add additional whitespace/change brace style if you want.
 
so (1 2 ⋄ 3 4)?
 
No, that'd be equivalent of (1 2)(3 4)
[
 1 2
 3 4
]
 
oh
what about representing 2 2 2pi8?
 
10:05 AM
[[1 2
  3 4]
 [5 6
  7 8]]
And again, you can inline or partially inline, or add additional whitespace etc.
[[1 2 ⋄ 3 4]
 [5 6 ⋄ 7 8]]
Or [[1 2 ⋄ 3 4] ⋄ [5 6 ⋄ 7 8]]
[[1 2
  3 4] ⋄ [5 6
          7 8]]
 
ok
this stuff is cool
 
@Adám is this present in the latest 18.2 beta that just came out, do you know? I've not installed it yet.
 
@xpqz Even 18.0 has a model implementation for it. But in 18.2 it is really easy to access:
      ]repr -f=aplan 2 2⍴⍳4
[
  1 2
  3 4
]
Link already uses this notation to store arrays in text files.
Btw, in my opinion, one of the most exciting things about it is the ability to write a literal inline namespace, e.g. (foo:'bar' ⋄ ans:42 ⋄ Avg:+⌿÷≢)
A non-obvious use is (⎕IO:0).⍳10
 
Ooh, I like the local ⎕IO one
 
It'll allow "named arguments" to functions: MyFn(arg1:'abc' ⋄ arg2:'def')
 
10:12 AM
@Adám wow that is.. suprising
ah the colons distinguish it
 
@Razetime Surprising? Not very different from JavaScript's {foo:'bar', ans:42, Avg:a=>a.reduce((x,y)=>x+y)/a.length} is it?
 
Ok, I'm downloading it now... but to be clear, this will allow me to write
a ← [[1 2
      3 4]
     [5 6
      7 8]]
in the repl and inside dfns?
 
No.
 
@Adám yep not very far off, but it's an interesting choice to have parens as the enclosing chars
 
oh :(
 
10:16 AM
@xpqz I mean, yes, it will in the future, but you can't do that in 18.2
@Razetime What would you use?
 
i'm not sure lol
 
{name:val} is taken.
 
but it's interesting
yeah that's a dfn guard
 
[name:value] would work, but then the empty namespace couldn't be []
 
can () actually be used as an empty namespace?
 
10:18 AM
Yes.
 
neat
 
      ]repr -f=aplan ⎕NS⍬
(
)
 
but a ← [[1 2⋄3 4]⋄[5 6⋄7 8]] should work?
 
@xpqz But if you use Link, you can put the notation in a.apla and it'd work.
 
I like this a lot.
 
10:19 AM
@xpqz No, but a←⎕SE.Dyalog.Array.Deserialise'[[1 2⋄3 4]⋄[5 6⋄7 8]]' will.
It isn't multi-line support that's missing in 18.2 – that is fully implemented.
Getting multi-line support was groundwork for the future array notation support.
@xpqz Actually, I included a hack, so you can write:
a←{
   [[1 2
     3 4]
    [5 6
     7 8]]
}⎕SE.Dyalog.Array.Inline⍬
in both dfns and the REPL.
 
For this to work with ]link, is the .apla suffix required, or will link work it out?
 
Yes, .apla is required. Link will also create .apla files for any arrays you ]add
This is fun:
      ({(foo:'bar' ⋄ ans:42 ⋄ Avg:+⌿÷≢)}⎕SE.Dyalog.Array.Inline⍬).Avg 3 1 4 1 5
2.8
 
10:43 AM
@Adám Btw, is Cider, as opposed to Acre, the go-to way to manage projects in the future?
 
@Bubbler That is my understanding.
 
11:02 AM
@Bubbler There is also Carlisle's Dado: github.com/the-carlisle-group/Dado I'm intending to have a play with both Dado and Cider/Tatin in the near-ish future
Oh my bad Dado ≡ Acre
but Dado's package strategy is to rely on GitHub, so I might lean towards Tatin
 
 
4 hours later…
3:24 PM
Is there a good name for dyadic grade down/up
 
"Grade by"
Though it is really "grades"
 
Thanks
 
Other possible names are "custom grade" or "collated grade".
I wonder what you need it for…
"specified grade"
 
Ooh. Want feedback?
 
3:29 PM
I've never used dyadic grade, lol. Seems like grade by is apt, from a quick aplwiki read.

And yes, although I still have a lot to add
 
I'd keep the dot everywhere, to indicate if a function is dyadic-only.
E.g. LCM and And are the same function.
 
Good point. Does the NuVoc specify if a verb is strictly dyadic?
 
Yes. See e.g. E. and contrast with }:
 
Ah, I see.
 
@FawnLocke Dyadic and can be called "Namespace execute" and "Specified format".
 
3:33 PM
Ah, I didn't know there was a dyadic form. Neat
 
Dyadic is Materialise, not Index.
 
Do you mean monadic ⌷ is materialise?
Judging from squad
 
Yes, sorry. Of course.
 
Alright, noted
 
I suppose you're planning doc-links, and adding operators.
 
3:37 PM
Yes
 
It'll be awesome. Definitely something I'll guide people to.
 
:) Well, I've been talking a lot about Dyalog's documentation lately. I'll be sure to make the changes/additions I wish to see once my personal life is less busy
 
Feature idea: checkboxes for categories mathematical/structural/function application/etc. and then fade out those that are not covered by selected categories.
 
Yep, will totally get around to that. Do you think there's value on the documentation being on the same website? I wonder if the experience is worsened by having to traverse to the wiki often
 
Are you going to link to the Wiki or straight to the docs, being that this is Dyalog specific?
 
3:43 PM
I was going to link to the wiki, but it's apparent Dyalog's docs would be better. Again, I could curate the documentation myself and source both where appropriate
 
I can't wait.
 
@FawnLocke Nice work; would be nice if something like this was available on a ]UCMD in the repl...
Like k's ref-card
 
@xpqz Oh it already is ;-) Once you've installed 18.2, try ]html 'awagga.github.io/dyalog/voc'
 
Sure. And on the command-line using curl -s 'https://... :)
 
Uh, but ]html should render it as part of the IDE.
@xpqz My early 2017 suggestion to overhauling the Language Elements page:
Same year I suggested overhauling the language bar.
But none of these separate monadics from dyadics.
In the early days of APLcart, I had primitives as single entries. Then I split them, and I'm quite happy with that decision.
 
Much better, though I don't really like the underscores. Also, you don't need the APL font for the names.
 
Yeah, would you just have the underscores be blank spaces? I think it helps emphasise dyadic-only visually, but it is ugly.
 
@FawnLocke How about using something lighter, like · or a greyed out ?
 
Nice idea, thanks.
 
I'd rename the two "Grade by"s to "Collated grade up" and "Collated grade down".
@FawnLocke You can use local APL385 Unicode if available, and only serve it if necessary, for faster load times.
 
4:11 PM
Yep, yep. I was gonna get around to that. Can I ask about your reasoning for prefixing with collated?
 
@Adám oh yeah so it does!
 
Because J has an unrelated function called "grade by".
 
 
Right, thanks
 
Whereas the left argument specifies a collation order.
^ uses APL333 for text.
 
4:14 PM
Ooo, that's quite pretty.
Of course, nothing will ever beat the beauty of SAX2 :)
 
Agreed.
 
adr
4:47 PM
@xpqz Browsing other folks solutions to day 6. Curious about this line in yours:

⎕FR ⎕PP ⎕IO←1287 34 0

⎕IO I'm familiar with, but what are the other 2 good for? I'm having difficulty "quacking"/googling them.
 
@user15174083 Hi myNameJettski. If you want to participate here, please email access@apl.chat
@adr Did you try APLcarting or ]helping them? Or even pressing F1 on them?
 
adr
Did not know about `]help` or the f1 trick. Very handy. However:

]help ⎕FR
┌→──────────────────────────────────────┐
│https://help.dyalog.com/18.0/#search-FR│
└───────────────────────────────────────┘

which is an article on `Format Date-time` (keying on fr for french)

but F1 appears to get the gist! https://help.dyalog.com/18.0/index.htm#Language/System%20Functions/fr.htm

That's a very helpful. Thank you.

Is there a way to type APL glyphs directly into aplcart with a prefix?
 
@adr What OS are you on?
Also, ]help ⎕FR works for me. Let's see what the bot says: ⋄]help ⎕FR
 
Odd.
 
adr
4:56 PM
I am on MacOS. I have yet to enable an APL keyboard system wide.

Incidentally, that's also why I had to think for a bit as to how to get F1 to show up on this awful touchbar
 
Poor you.
abrudz.github.io/lb/apl should do the trick.
It may look all mangled, but click ❎ and it should be alright.
 
adr
Great. Thanks!
 
18.2 will have APLcart built-in…
 
adr
APLCart has been extremely useful for discovering idioms, that'll be nice to have it built in.
 
5:15 PM
@adr I assume you figured it out, but if not, they're useful settings for dealing with large numbers. When set like that, ⎕FR enables 128-bit decimal floating-point operations, and ⎕PP sets the print precision -- the number of significant digits in the display of numeric output.
In AoC you'll eventually run out of Dyalog's number sizes and have to resort to trickery. But these two settings get you a fair way.
 
i.imgur.com/hdlupQB.png Would this be correct?, The arity is the same in both commute and constant, so I'm unsure
 
@FawnLocke Operators are different from functions. Each one is strictly monadic or strictly dyadic. However, they can have vastly different meanings depending on operand types (array vs function) so you have to come up with a different scheme.
 
Gotcha
 
is Constant if the operand is an array, otherwise, if the derived function is used monadically, it is "self" and if dyadically, "swap". Maybe "commute" can be used for both "self" and "swap", however. Up to you.
depends on the right operand only (the left has to be a function). Array r-op gives Rank, function r-op gives Atop. However, there's no need to separate monadic and dyadic usage of the derived function.
 
Yeah. I'll think about it. ⍨ is definitely the most confusing of the operators
 
5:23 PM
Nah, is even worse, I think.
 
True
 
f∘A and A∘f are both Bind (and can only be used monadically), while f∘g is Beside (and is ambivalent).
and / (etc.) always takes a function operand, but the derived monadic and dyadic functions are vastly different.
 
Yep. I wonder if BQN is less confusing in this regard, with it's 1st class functions
 
BQN has the benefit that the type of the operands never matter; array operands are simply treated as constant function operands.
 
Oh, interesting
 
5:26 PM
And yes, each BQN operator has only one meaning.
 
5:36 PM
What about simply defining the operand type? i.imgur.com/kfX3Qmm.png
 
Sure, that'd work.
 
X ⍨ can be used monadically and dyadically, right?
 
Yes.
 
Thanks :)
 
5:52 PM
https://i.imgur.com/Ge0lAtm.png

I feel like this might get confusing, thoughts? Is it well enough expressed that Each is ambivalent, and Constant is the same regardless of arity
 
@FawnLocke That doesn't sound right. Each and Constant are exactly equivalent.
Maybe for operators, it is enough to split (with a dot) the few that need separate treatment for the monadic and dyadic derived functions. I think there are only 5: ⌸/\⌿⍀
 
They are semantically. But Each has two separate uses that I need to link to, Constant always returns the operand
 
Oh, I see.
Then maybe split all of them for consistency?
 
That sounds like a good idea
 
Have you considered using light dots throughout?
 
6:00 PM
Yes, I think it's cleaner. It would be nice to show something has strict arity besides the whitespace but /shrug
 
Well, none of them really do have "strict" valence. You might not be able to apply the function, but it isn't syntactically wrong.
 
That's true
 
E.g. =⍣0⍳4 "uses" = monadically.
@FawnLocke "Replicate • Reduce" isn't right. There's Replicate is dyadic with no monadic functionality. Reduce needs to go to the operator table as the monadic counterpart to N-wise reduce.
 
Ah, my bad.
 
(Or "Windowed reduce" if you prefer.)
 
6:11 PM
Let me know if you spot any further mistakes. I'll continue this tomorrow. Thanks for your time and feedback, as always.
 
6:28 PM
@MaciejGoszczycki Welcome to the APL Orchard!
 
Yes, I've messed with array languages before but trying to learn APL as part of this year's Advent of Code. For Dyalog, I've been trying to wrap my head around SALT (before I found out it's supposed to be replaced with LINK) and I don't quite understand something. If I have a SALTed namespace, is there now way to add new functions/variables to it? I assign them, but ]saveing them doesn't add them to the file.
Not that it really matters, since I think I might just use ]defs and copy and paste my stuff into a single file when I'm done (at least for Advent of Code)
 
@MaciejGoszczycki Once SALT has created a source for your namespace, you'll want to use )ed mynamespace to edit that directly. However, ]scriptUpdate can update your source if you've done further assignments.
That said, you should really look into using Link.
@FawnLocke You'll probably want to put monadic and dyadic operators into separate tables.
 
Definitely
 
@Adám Ah!, Thanks, I actually found ]scriptUpdate but I assumed there must exist some salt-approved way to do it instead. Just out of curiosity, is there a way to ed a freshly created namespace - on new namespaces ed only shows the namespace path.
I'll definitely look into Link later, I just didn't know about it until recently and I was really curious if I was missing some trick with SALT
 
6:47 PM
@MaciejGoszczycki You can initiate and edit a new namespace with )ed ⍟newns or create a scripted namespace without editing it with ⎕FIX':Namespace newns' ':EndNamespace'
 
Oh wow, didn't think about using one of the ed options.
How do people here wok on small scripts (stuff you could feed into mapl), just iterate and ]defs?
 
I treat the Dyalog repl like an OS and run my scripts from it, usually with 2⎕FIX'file://*.apl'
#!/bin/bash
dyalog -script <(echo ∇M;tail -n+3 "$0";echo -e '∇\nM\n⎕off');exit $?
⎕←⍬⋄⎕io⎕pp⎕pw←0 34 32767⋄{}⎕se.UCMD'←box on -s=max -f=on'⊣enableSALT⊣⎕cy'salt'
Might be useful to you, haven't tested it recently
 
7:07 PM
Can't wait for 18.2…
2
 
Ah, that's neat it makes the script FIXable.
I did read in the Link docs the 18.2 introduces a "scripting engine", that should make this stuff a lot easier, I think I only found out about `-script` through this chat.
Thanks a million!
 
@MaciejGoszczycki you can see a bit how it will work in 18.2 in my book's workflow chapter here: xpqz.github.io/learnapl/workflow.html
Also covers ]link
 

« first day (1777 days earlier)      last day (864 days later) »