« first day (1685 days earlier)      last day (972 days later) » 

4:30 AM
@user @Bubbler I think you'll find that it depends largely on the programmer. CS-type are likely to always use ⎕IO←0 while mathematicians sometimes will, and business people will usually stick to ⎕IO←1. Ancient code will use ⎕ML←0 and new will use ⎕ML←1 while medium-aged code, and code that has been ported from or written by people from other APLs will use ⎕ML←3. I don't think I've ever seen ⎕ML←2 used.
 
4:58 AM
I like the idea of choosing index origin based on problem context. but ⎕io implemented as a system variable is sometimes annoying.
 
Iverson actually had it as a subscript on functions themselves.
 
Also user-written functions often have ⎕IO←(0 or 1) on its first line as a local setting
 
the iota in A Programming Language is more like "range".
non 0/1 "index origin" can also be supplied.
 
5:13 AM
@LdBeth Indeed. I never noticed. Makes sense that it is called interval vector then, and hence . So now that we use it doesn't actually fit the meaning, and those languages that have adopted Iota are doing so in "error".
 
 
2 hours later…
6:55 AM
how to input multiple lines in RIDE?
 
@1234 What exactly are you trying to do? Define a multi-line function or prompt for multiple lines of input, or something else?
 
yep, try to define a multiple line function
f ← {⍺+⍵}
{ ---> line one
⍺+⍵. --> line two
} --- line three
 
It is probably nicest to write )ed f then edit and press Escape when done.
However, if you want to try an experimental feature, you can set the environment variable (or command line parameter) DYALOG_LINEEDITOR_MODE=1 in which case it may "just work".
Alternatively, you can begin the first line with and end the last line with :
∇f←{
⍺+⍵
}∇
 
Cool, It is hard to believe RIDE still can not use multiple line input yet,
 
RIDE is a "dumb" frontend. It has very little clue about what's going on. It is the interpreter that handles function definition. If the interpreter accepts multi-line input, then RIDE does too.
 
7:03 AM
so the interpreter has hard time to accept multiple line input?
 
No, it just has to be enabled.
 
Ok, I will try it.. thanks
 
@user I think you should take a look at this lecture by Simon Peyton Jones youtube.com/watch?v=brE_dyedGm0&t=3454s
Basically the benefit of having a type system is not linear, but parabolic, for example though Coq has the higher guarantee than Haskell, becoming productive in Coq is significantly much harder than Haskell, Jones also joked about you need to have a Phd to be able to write Coq
So, arguably, having a type system in APL might not have a net positive due to the rank-polymorphism
Aaron also has a nice talk regarding this topic youtube.com/watch?v=z8MVKianh54&t=4s
In short, he said the type annotation would be longer than the actual code itself
 
@WongJiaHau How is that important?
 
@Adám sorry which one do you mean?
 
7:14 AM
Why does it matter that the type annotation would be longer than the code?
 
@Adám then it would be bad in terms of productivity
"long" might be a bad description, "arcane" should be a better description
 
Except if all the type annotations could cut down on bugs, no?
 
for glue code yes
so I was suggesting to have gradual type system (a la typescript) for BQN
basically we can give the 'any' type to all the primitives since they are not trivial to type, but user should be allowed to define simple types like functions, record/structure, adt etc
 
Having records and ADTs would be definitely nice
 
@Bubbler yea especially when interfacing with external systems
 
7:22 AM
Not necessarily external systems. I once tried golfing an actual ADT manipulation task in pure APL, it was crazy
Magic numbers for tags and tag-dependent destructuring assignments all over the place
 
Can someone explain me what is entropy
 
@RudraJoshi Are you sure you're in the right room? (Also, did you try Wikipedia?)
 
This isn't a general programming chatroom (or general "anything" chatroom)
 
@Bubbler I would imagine you have the first column as the tag, and the rest of the columns as the properties, is this right?
 
@Bubbler General APL, as opposed to specific (implementation/dialect of) APL :-)
 
7:27 AM
@Adám so some APL has ADT?
 
What is an ADT?
 
Algebraic Data Type, basically sum and product type
 
I don't know enough CS to answer. Sorry.
 
7:48 AM
When do we usually use a hook?
 
in APL? never :P
 
@WongJiaHau Any time you want to somehow combine the original value with a processed value. Monadic example: IsPalindrome←⊢≡⌽ or IsPalindrome←≡∘⌽⍨
Dyadic example: IsReverseOf←≡∘⌽
@rak1507 Not true. X f∘g Y is a hook.
 
to me a hook means the (f g) form
 
That's a mistake. A hook is the compositional form, not its notation.
 
Ah, ok
 
7:52 AM
 
8:08 AM
how to understand this? ≡∘⌽⍨
 
@WongJiaHau It is monadic, so ≡∘⌽⍨{≡∘⌽⍨⍵}{⍵≡∘⌽⍵}{⍵≡⌽⍵}
 
8:30 AM
≡∘(⌽⍨) is this correct?
 
@WongJiaHau Not sure what you're asking. Are you asking if this is how ≡∘⌽⍨ binds? Then no, it isn't.
 
oh then what is the correct binding?
 
(≡∘⌽)⍨
Operators have long left scope and short right scope, mirrored from what functions have.
@Mast Hi there. Interested in APL?
 
oh no wonder
is (f∘g) x the same as f g x?
suppose f and g are functions and x is an array
 
8:38 AM
Ah so when use dyadically, f∘g forms a hook?
 
Thanks
 
Maybe I should add the monadic hook (f∘g⍨) to APLcart too?
 
@Adám yea that would be great
 
8:57 AM
@WongJiaHau Added.
 
@Adám thanks
can you also help me review the examples I added here? aplwiki.com/wiki/Beside#Examples
 
@WongJiaHau Done.
 
thanks, oh no there are two types of hook ?!
i just realized monadic hook and dyadic hook is different @.@
 
Well, "hook" is an artificial name we can decide the meaning of. Some clever people decided that X f g Y and Y f g Y should both be called "hook".
Similarly with "beside": Some clever people decided that X f g Y and f g Y should be called "beside".
Similarly with "atop": Some clever people decided that f X g Y and f g Y should be called "atop".
Similarly with "over": Some clever people decided that (g X)f(g Y) and f g Y should both be called "over".
 
9:16 AM
so basically all kinds of trains has two variants: monadic and dyadic. is this correct?
 
There are infinitely many possible compositions of two functions, both for dyadic application and for monadic application. We can call them what we want (though a consensus would be nice) and we can give any subset of them whichever names we want (though a consensus would be nice), and when we do that, we can let arbitrary pairs of monadic and dyadic compositions share a glyph (though a consensus would be nice).
@WongJiaHau All kinds of derived functions, yes. Trains are but a subset of derived functions.
 
@Adám ah, so I just have to treat a train as a function
 
A train is a function.
 
ok need to wrap my head around that, don't know why I think of them as different stuff all along
 
@WongJiaHau Trains are special in being compositions of three functions, while all other APL compositions are of two functions. (Though you could also look at as forming a type of composition, albeit with a single function.)
 
9:25 AM
@Adám thanks
 
@WongJiaHau Have you wrapped your head around the two atop forms being equivalent? (f g) vs f⍤g
 
do you know how you can display two histograms on the same chart?
 
@rak1507 You mean with SharpPlot?
 
yes
when I just try and add another I get 'multiple expressions mapping to the same series of chart1'
 
@Adám I'm haven't read about the operator yet
 
9:28 AM
oh, if I just add a new chart it overlays, nvm
 
can't seem to find the wiki page about ⍤
 
@WongJiaHau Well, you know about monadic f∘g – they are the same monadically.
@WongJiaHau Someone has to write those articles… Meanwhile, the documentation exists.
 
o i see, so I guess the 2 dots above the jot implies dyadic?
 
No, the similar symbols just mean they are related.
 
What's the name for ⍤?
 
9:31 AM
The symbol or the primitive?
 
what's the difference between small mouth and big mouth
 
@Adám primitive
 
Atop.
 
ok so small mouth is called atop, big mouth is called over?
and the eye-less is called beside?
 
9:33 AM
Yes, but their English names are not very important.
 
Why?
 
I think of f∘g as "use g to pre-process the right argument of f". I think of f⍥g as "use g to pre-process all arguments of f". I think of f⍤g as "use f to post-process the result of g".
@WongJiaHau When you converse in English, do you think it is important that w is called "double-yoo"?
 
If I need to refer to it specifically, for example when spelling a word verbally, then yes
in that way, f⍥g if use monadically, it is the same as f∘g right?
 
Yes, but I recommend using for the monadic case whenever possible.
@WongJiaHau Anyway, once you see that (f g) is just a choice of interpreting two consecutive functions in isolation as f⍤g then you might ask if it'd be possible to define one (or two) operators so that (f g h) might be written with operators in the "spaces" rather than through a series of three consecutive functions.
And yes, it is possible:
     (⊢   -   (+/   ÷   ≢)) 3 1 4 1 5
0.2 ¯1.8 1.2 ¯1.8 2.2
      ⊢_fk-fk_(+/_fk÷fk_≢)  3 1 4 1 5
0.2 ¯1.8 1.2 ¯1.8 2.2
Here, _fk and fk_ are dyadic operators (which you can find in the dfns workspace or on APLcart).
 
9:50 AM
Is ^/2</x y z the same as the math notation x < y < z?
 
Uh, yes, sure, if x and y and z are scalars.
I'd prefer to write (x<y)∧(y<z)
CMC: Rewrite monadic ⊢-+⌿÷≢ as a derived function by reordering the symbols and adding s and s and parentheses.
 
I see. What is CMC.
 
I assume -∘(⌹∘(=⍨)⍨)⍨ is cheating?
 
@rak1507 Yes, as that doesn't abide by the spec of "reordering the symbols and adding s and s and parentheses."
 
\○/
 
9:57 AM
:(
 
I've got 17.
 
⊢-+⌿÷≢ this means negative mean right? just want to confirmed before i start
 
-∘(÷∘≢⍨∘(+⌿)⍨)⍨ then
 
@WongJiaHau No, it means subtract the mean from the argument.
@rak1507 Same as mine.
 
oh i have to treat - dyadically?
 
10:00 AM
@Adám that's 15 not 17 :P
 
You're missing ∘⊢
 
huh?
what does that do
 
@WongJiaHau Yes. You may want to review some of the tutorials on trains to get how longer trains work.
@rak1507 Nothing.
 
oh, you have to use all the symbols in there?
 
> reordering the symbols and adding s and s and parentheses.
 
10:03 AM
@Adám the challenge means to rewrite the expression as trainless right?
 
Yes.
 
@WongJiaHau I wrote a bit on trains, too: xpqz.github.io/learnapl/tacit.html
 
@Adám don't you need another ?
 
@rak1507 Really, the challenge is to rewrite an arbitrary (monadic) sequence of functions to a derived function using and and parens.
 
it's not too hard
x - (+⌿x)÷(≢x)
x - f x
-∘f⍨ x
(+⌿x)÷(≢x)
(+⌿x)÷∘≢x
x÷∘≢⍨+⌿x
÷∘≢∘(+⌿)⍨ x
-∘(÷∘≢∘(+⌿)⍨)⍨
 
10:05 AM
@dzaima How so?
 
@xpqz so (a b c d) means (a (b c d)) right assuming a b c d are functions
 
yes
 
@Adám -∘(÷∘≢⍨∘(+/)⍨)⍨∘⊢⍨
 
-∘(÷∘≢⍨∘(+/)⍨)⍨∘⊢ works fine
 
so trains are also right-associative is this correct?
 
10:06 AM
Yes.
 
@rak1507 it works fine, but it does (⊢-(+⌿÷≢)∘⊢) and not (⊢-+⌿÷≢)
 
ok, so function call and trains are right associative, while operator call is left-associative
 
@rak1507 Hm, so we zigzag, while the right and middle gets and parenthesise the middle?
f g h i j
g∘(i∘j⍨∘h⍨)⍨∘f⍨
@benWindsorCode Welcome to the APL Orchard. I see that you've welcomed feedback on your answer:
3
A: "-rot" transform

benWindsorCodeAPL (Dyalog Classic), 50 bytes {⎕←1↑⍵⋄({(3↓⍵),⍨(+/2↑1⌽3↑⍵),1↑⍵}⍣{⎕←1↑⍺⋄(⍴⍺)<3})⍵} Try it online! Explanation: (+/2↑1⌽3↑⍵),1↑⍵ take the first three elements, rotate them, sum the first two and stick the third (which was originally the first element) on the end again so (a b c) -> (b c a) -> (b+...

 
10:35 AM
would be a lot shorter porting jelly probably
 
10:46 AM
ok so the formula to translate a (f g h) fork using on ⍨ and ∘ is to turn it into (g∘h⍨∘f⍨)?
 
yep
 
With explicit parenthes: (((g∘h)⍨∘f)⍨)
ah my brain
 
@WongJiaHau Actually, g⍨∘f⍨∘h would be more correct (and slightly easier to read, imo).
 
      (f g h) 3
¯4
      g∘h⍨∘f⍨ 3
¯4
      g⍨∘h⍨∘f⍨ 3
4
      g⍨∘f⍨∘h 3
10
 
Huh.
 
10:51 AM
@rak1507 wait so nobody is correct now?
 
@WongJiaHau g∘h⍨∘f⍨ is right
 
No, g∘h⍨∘f⍨ gives the right result.
 
(f g h) x
(f x) g (h x)
(f x) g∘h x
x g∘h⍨ f x
g∘h⍨∘f⍨ x
 
 (f g h) x
 (f x) g (h x)
 (h x) g⍨ (f x)
 (h x) g⍨∘f x
 x g⍨∘f⍨ h x
 x g⍨∘f⍨∘h x
 g⍨∘f⍨∘h⍨ x
Where's my mistake here?
 
that works
you must have just missed the ⍨ at the end
 
10:55 AM
@rak1507 Oh, right copy-paste error. It is indeed in my APL session ⍨
Now, as to why g⍨∘f⍨∘h⍨ is more correct than g∘h⍨∘f⍨
 
why?
 
      f←{⎕←'f'}
      g←{⎕←'g'}
      h←{⎕←'h'}
      (f g h)'a'
h
f
g
      g⍨∘f⍨∘h⍨'a'
h
f
g
      g∘h⍨∘f⍨'a'
f
h
g
Or in other words, the right tine is applied before the left tine.
 
ah, application order
I really hope no one uses side effects in trains but inevitably someone will...
 
I do. It is really useful for avoiding lingering names.
 
what does 'lingering name' means?
 
11:00 AM
:(
 
I might want some operation that analyses existing names, so I can't use temporary variables.
 
I see
is there some settings that I can use in TryAPL such that I can see the evaluation of an expression step by step?
 
@WongJiaHau Not really, but just Entering a tacit function (train/derived) will show you a tree structure: ⎕←⊢-+⌿÷≢
 
@Adám
┌─┼───┐
⊢ - ┌─┼─┐
    ⌿ ÷ ≢
  ┌─┘
  +
 
⎕←-∘(÷∘≢⍨∘(+⌿)⍨)⍨∘⊢
 
11:04 AM
but seeing this isn't enough for me to really understand g⍨∘f⍨∘h⍨
 
@Adám
         ∘
        ┌┴┐
        ⍨ ⊢
      ┌─┘
      ∘
     ┌┴┐
     - ⍨
     ┌─┘
     ∘
   ┌─┴─┐
   ⍨   ⌿
 ┌─┘ ┌─┘
 ∘   +
┌┴┐
÷ ≢
 
@WongJiaHau Not even ⎕←{g}⍨∘{f}⍨∘{h}⍨?
 
@Adám
        ⍨
      ┌─┘
      ∘
     ┌┴┐
     ⍨ {h}
   ┌─┘
   ∘
  ┌┴┐
  ⍨ {f}
┌─┘
{g}
 
Read this from the top…
 
In Dyalog, is ∘ an operator?
 
11:06 AM
yes
 
@EliasMårtenson ^ except in ∘.
 
the part that I don't understand is how in the end g will receive the result from f and h
 
@Adám Yes, of course.
 
g⍨∘f⍨∘h⍨ x
x g⍨∘f⍨∘h x
x g⍨∘f⍨ h x
(h x) g⍨∘f x
(h x) g⍨ (f x)
(f x) g (h x)
 
@WongJiaHau The overall function has at the outermost layer: g⍨∘f⍨∘h⍨x is x g⍨∘f⍨∘h x
 
11:08 AM
@Adám So is ∘ also a function (like a "null function")? Or is it considered special syntax?
In the case of ∘.FN
 
Special syntax.
 
Thanks.
 
In Sharp APL, it was a regular array just like
 
Or even better: apl.wiki/Jot
 
11:09 AM
@WongJiaHau I'm familiar with how these operators work. I wanted to know how it's implemented on the Dyalog side.
 
If I was implementing an interpreter for this (though of course I would choose to add this wart) I'd start by replacing all ∘.s
 
Kap implements ∘ as a function (called NullFunction), which raises an error when called. The product operator has a special case where it checks if the left function is NullFunction and delegates to outer product if it is (outer product is actually called ⌺ in Kap, with the NullFunction hack mainly being there for the purposes of APL compatibilty.
@Adám Replace, how? You mean having a dedicated outer product operator?
 
@Adám +∘.1
 
@EliasMårtenson But then you can use for composition, arguably a much more important/powerful usage, especially since you have for outer product and it can also be written using .
 
@Adám I already have ∘ for composition as well.
 
11:14 AM
@rak1507 Ugh, yeah, OK, token formation first, then replace ∘.
@EliasMårtenson Then what syntactic role does play then?
 
@Adám No syntactic role. It's both an operator and a function.
I was asking about Dyalog whether it implemented ∘ the same way, or if the parser itself has special knowledge of it.
 
A hybrid… SOS.
 
Save Our Souls.
 
Hah, well. There is already /
 
11:15 AM
@EliasMårtenson dzaima/APL just has a special parser rule for ∘., which is implemented as a regular monadic operator. ∘. doesn't have any or . anywhere
 
But yes, I would actually like to get rid of the function role for ∘. It would make things a lot more clean.
I only added it at some point to be APL compatible :-)
 
@EliasMårtenson KAP is already so not-compatible, I think you could just get rid of ∘.
 
@Adám Thank you for the encouragement. I think I will.
 
But I'm not sure I agree on using . Seems very heavy for such a basic thing.
 
wdym by 'heavy'
 
11:17 AM
x g⍨∘f⍨ h x
(h x) g⍨∘f x
@rak1507 oh I know what I'm missing
 
@Adám "heavy" as in its shape?
 
Yes. Lots going on in that symbol.
 
I just found out that ⍨ means swap when use dyadically
 
@EliasMårtenson Remind me, did you split the other hybrids?
@WongJiaHau ⍨
 
@EliasMårtenson you can keep the syntax but get rid of any role funkiness by just handling it as a special case in the parser
 
11:18 AM
Agree. The multiplication table looks ugly ×⌺⍨⍳10
 
but I still don't get it, the parsed tree clearly doesn't show that ⍨ is being used dyadically
 
@Adám You mean / ?
No I didn't.
 
@EliasMårtenson Well, either way, you could overload and/or \ for outer product.
I'd highly recommend splitting them as dzaima has done.
There's no need for the trailing axis editions if you have Rank, so the dashed symbols can be a pair, and the non-dashed the other pair.
 
@Adám I could, but it doesn't look like a product :-) I picked ⌺ partly because it's a rectangle.
 
I think 1 2 3 ×\ 1 2 3 4 looks fine.
 
11:21 AM
dzaima/APL has as a proper monadic operator for ∘. fwiw
 
It does.
@dzaima Oh... Pretty.
 
I guess i thought it was . + , but it's +
 
exists.
 
@Adám so it does
 
@Adám by the way, in the recent arraycast, you mentioned a palindromic palindrome checker, where each symbol was vertically symmetric. While driving to the office, listening to that episode, I was trying to figure out what that looked like, but failed. Clearly the symmetric symbols are ⌽ and ≡, but how to make it palindromic?
 
11:25 AM
@EliasMårtenson It is in the show notes ("0:54:50 Palindromic Palindrome Checker in APL"): ⌷≡⌽⌽≡⌷
 
⌷≡⌽⌽≡⌷ iirc
ah, beat me to it
 
@dzaima Such pretty symbols. If I didn't have such a severe case of decision anxiety, I'd use all of them.
@Adám Wait what? OK, give me a moment to parse that one.
 
@EliasMårtenson BQN uses for outer product. Another candidate was
I think these are good because they show how the rank is extended based on the args.
 
Ah, BQN's choice isn't bad at all.
Thanks for ⌷≡⌽⌽≡⌷. It revealed a bug in KAP.
 
@EliasMårtenson Wouldn't be better?
(Just don't confuse it with 🝕 which stinks.)
 
11:29 AM
@EliasMårtenson monadic ⌷ is kinda pointless
 
What does monadic do in KAP?
 
@Adám It definitely represents the action better than ⌺
@Adám Nothing. That's the bug.
Not implemented.
 
Well, what would you have it do?
 
The same as Dyalog.
 
⌷ in dyalog is just a no op
 
11:31 AM
No, it returns the elements of the default property of objects.
 
so I wouldn't bother, unless you're interfacing with things and you actually do need the 'materialise' thing but you probably don't
 
It's identity isn't it?
 
Only for arrays that are not collection-type objects.
 
 
1 hour later…
12:48 PM
What is monadic ≡ useful for? I've never needed it myself.
 
Mostly analysing arrays. E.g. asserting that an array is simple with 1≥|≡
Or checking that you've got a vector of simple vectors (1=≢⍤⍴)∧(2=≡)∧(1∧.=≢∘⍴¨)
 
Thought so. So the main use is just to check if it's =0 or >0. In KAP, a much more efficient way to find that would be {1∊{⍬≢⍴⍵}¨⍵}
 
@Adám Not really, I was just taking a look at the room.
 
Perhaps I should make ≡ return only 0 or 1. 0 for simple vectors, an d1 for compound.
 
I don't need a golfing language to write incomprehensible programs.
;-)
 
1:01 PM
@Mast APL is not a golfing language, though.
@EliasMårtenson Well, in the above, I check for 0, 1, and 2…
Dyalog's version can also be used to check for raggedness with 0>≡
 
@Adám I see.
 
@Adám I'm sorry.
Using mathematical notation to program must be a joy as a mathematician. For simpler people like me, it looks quite complicated.
 
@Mast APL can be difficult to learn. But it may surprise you that it's not actually the notation that makes it difficult.
 
@Mast I'd argue that APL is essentially a simpler language than many popular ones.
 
The main problem is that you have to think about solving problems in a different way.
 
1:06 PM
And about language in a different way, if you're unfamiliar with the notation.
 
Indeed.
 
@Mast APL is actually quite similar in structure to English (and probably to Dutch too then).
 
You can learn the syntax of the language in a few hours. That's really easy. The difficulty comes when you put the pieces together, since you do it in a way that is quite different from most other languages.
 
@Adám Considering Dutch is more complicated than most programming languages I know, I'm not sure that's a good thing.
 
But, it's also very satisfying when you do.
@Mast Well, I find Dutch remarkably readable since I already speak Swedish and some German. However, coming to APL from, say, Java is like coming to Dutch if all you know is Chinese.
I'm sure @Adám is going to criticise me for making it seem like APL is the super-difficult thing.
 
1:09 PM
Besides, I have too many hobbies already and no use-case for APL. I'm actually quite terrible at programming, despite the many years of practice.
 
It's not true actually, like @Adám said, it's very simple.
@Mast then perhaps you should give it a go? I've heard it mentioned in many places that the people who find it easiest to learn are people with no pre-conceived notions of other languages.
 
That's probably true. If you don't know it's supposed to be hard, it usually isn't.
And if it looks more complicated than it is, it's perfectly learnable indeed.
 
@Mast If you've struggled with programming for years, APL might actually turn out a good fit for you.
However, @EliasMårtenson we might come across as pushy, so I'll be quiet now.
 
Don't worry about it :-)
 
@Adám have you ever visited a Haskell forum? :-)
There is this famous chat log from #haskell on IRC, where a troll comes in trying to make fun of the people there. The log ends with the guy being converted and starts to experiment with it. :-)
 
1:31 PM
I've tried Haskell. I didn't come so far that I understand it, but at least now I know the basics and why I don't understand it.
 
@EliasMårtenson can you please link it
i really want to read it
 
1:45 PM
this is an amazing chatlog
@Mast if you do consider trying out APL, feel free to ask for help and leanring resources here.
 
2:07 PM
@EliasMårtenson Where did this happen lol
 
@user It was on #haskell on Freenode at the time, I'd guess.
 
Ah
 
I'm using Dyalog on a mac. The default way to type symbols is to use the ` prefix. I'm wondering how do most APLers type symbols?
(I have tested on Windows and the default way is to use Ctrl as a combine key.)
 
@JunyuZhan I use the AltGr keyboard from @Adám on Windows: github.com/abrudz/Kbd
alt is a more convenient key than ` so i got used to it much easier
 
2:43 PM
@JunyuZhan Depends on tool. For GNU APL I use gnu-apl-mode which uses the super key. In Dyalog I use Ride, which loads a Linux keymap that also uses Super. However, that keymap is a bit flakey so having the ` prefix is helpful.
In KAP I use the Alt key, as part of the UI.
 
@JunyuZhan see aplwiki.com/wiki/Typing_glyphs , and if you are using Mac there's a freeware called Ukelele that enable's you create your own keyboard layout
I used that to create an APL layout for JIS keyboard, which I guess no one else would use that :P
 
3:14 PM
After implementing monadic ≡ the palindromic palindrome checker function now works: ⊣≡⌽⌽≡⊢
I find it prettier than the Dyalog version :-)
This works because in KAP, both monadic ⊣ and ⊢ are identity.
 
3:33 PM
Aren't they both identity in Dyalog too?
 
@user Yes, I just realised that.
They are in GNU APL (although one of them tags the result as non-printed (just like assignment)
For some reason I thought only ⊣ was identity in Dyalog.
 
Odd (GNU APL's behavior, that is)
 
@user It's quite useful. If you call a function for side effects that returns something large, you might not want to print it.
In Dyalog you need to do something like 0⊣somethingBig ...
 
But couldn't you just do _←big thing though?
Or that, it's just one extra character
 
But then you'll end up assigning it.
 
3:38 PM
Yours works, though (0⊣)
 
I think the idea in GNU APL is basically, "why not".
 
lol
 
I mean, GNU APL is very bound to its APL2 compatibility, which is fine. I do want to give them credit for some the good ideas they have, and the special behaviour of ⊣ is one of them.
At least in my opinion.
The idea of allowing double quotes is also a good idea. Where "a" is the same as ,'a'
That way strings with double quotes are consistent in a way that traditional single-quotes strings are not.
 
Yeah, it's very annoying when you have 'a' 'b' 'c' and it gets turned into 'abc'
 
@EliasMårtenson dzaima/APL does that fwiw
 
3:48 PM
@dzaima Good. It's the correct thing to do.
Does it use double quotes for proper strings like GNU APL?
 
@EliasMårtenson if that means escape parsing, then yes
 
I mean, is ⍴"a" equal to 1?
And what is ⍴'a' ?
 
@EliasMårtenson yes, that's what my original message was replying to
 
@dzaima Got it, thanks.
 
@EliasMårtenson
 
3:52 PM
The way it should be.
I simply didn't implement 'a'
:-)
 
so you just don't have single character constants?
 
@dzaima I do, but it's prefixed with @
so @f @o @o is "foo"
Yes yes, it's the worst syntax ever.
Problem is that ' is taken for quotation like Lisp.
And ` is taken for line continuation.
Point is, you're not really supposed to work with single characters, since it makes Unicode sad.
So you don't see it very often in practice.
 
@EliasMårtenson when you have constants is the one time when it makes sense to work with single characters though. Splitting on spaces or counting '('s is always safe regardless of unicode
 
@dzaima Yeah, fair enough.
I guess I was trying to justify the horrific syntax.
I mean, I really have nothing else :-)
 
 
5 hours later…
9:16 PM
Looking through code of the mystika repository I found the two function definitons:
mean←+⌿÷≢
var←×⍨∘mean-⍨∘mean×⍨
the var definition is the one I am confused about, at first I thought it was a three train with the '-' in the middle, but printing it out using ]boxing -trains=tree, I dont see it behave like that
my question is, given a right hand side argument, say '1 2 3 4', how does this '1 2 3 4' make it to both sides of the '-' operation, in particular how does it get all the way through to the mean on the left hand side?
I think I'm just not unwrapping the tacit code correctly, but the tree didnt' shed light for me intuitively
 
×⍨∘mean-⍨∘mean×⍨(×⍨∘mean)(-⍨∘mean)(×⍨)(×⍨∘mean ⍵)(-⍨∘mean)(×⍨ ⍵)(×⍨ mean ⍵) (-⍨∘mean) (×⍨ ⍵)(×⍨ mean ⍵) -⍨ mean (×⍨ ⍵)(mean ×⍨ ⍵) - (×⍨ mean ⍵)
 
@benWindsorCode what a coincidence, I was writing some stats stuff earlier today
imo my version var←+.×⍨⍤-∘mean⍨÷≢ is nicer :P
 
@dzaima Thank you very much, that certainly helps!
 
i'd personally write (mean×⍨) - ×⍨∘mean
 
@rak1507 interesting!
some nice range of functions here that I was browsing, is Aaron Hsu's work github.com/Co-dfns/mystika/blob/master/chron.dyalog
 

« first day (1685 days earlier)      last day (972 days later) »