« first day (1266 days earlier)      last day (387 days later) » 
01:00 - 16:0016:00 - 00:00

4:00 PM
Eg. As a arg-less function of things that have state. So that despite not taking params, it changes result depending on the state of the stuff inside
Whereas if it were an expression. It never would be re-evaluated
Right. There's a use case for both.
Any more questions before we close for today?
@Adám You did say that. I just thought an example might be helpful
@AviFS E.g. you could loop over something and for each one check for the existence of a file. You'd want to check each time.
There are plenty of cases where you want to run an expression each time the function is called. Another common one is using a dfn to append to a global accumulator.
A⍨ is for those cases where you truly want a constant value.
@Adám Can only think of one: is there homework? :P
@RGS No. Sorry.
4:05 PM
@Adám Argh, midway through writing one!
@Adám Crushing all my hopes and dreams D:
@AviFS Go ahead.
@AviFS I think Adám won't mind you asking something else out of APL Cultivation hours hehe
@Adám My one question is why this one-byte shortening (and admittedly optimized whatevers due to not rerunning) was added as opposed to countless other possibilities
Eg. the pair function mentioned earlier which removes need of parenthesis, thereby also shortening by one byte, making many expressions far more elegant and readable, but not actually adding any new functionality
It seems to me there are many potential operators in the category above (eg. with those 3 main traits of more elegant, slightly less code, perhaps more efficient, but no new functionality)
@AviFS It isn't just one-byte in the case where A⍨ occurs inside a longer train or before an operator. Also, you could make the same (or even a stronger) argument about N+M vs N--M. Notation as a tool of thought, I'd say.
4:08 PM
@Adám Notation as a tool of thought, definitely! The question was absolutely not why add this, but why was this chosen over others?
@AviFS is also much more clear often. Some order of implementing things must be chosen, and this managed to come before some others for Some Reasons™
Constant also had a very low cost, in that it fit nicely into an existing symbol, with no other sensible way to extend the domain of to arrays.
If there was some need for it spurred on by something in particular or such
@Adám Re: train. Can't {c} be used wherever c⍨ is used?
@dzaima That's a good point
@AviFS No, not really. I suggested a whole bunch of operators to add. Some were added in 18.0, others held off for later, and some not scheduled for implementation right now.
@Adám Also a very good point
@Adám I see! Well that answers my question!
4:10 PM
@AviFS afaik there's been discussion about whether the builtin for pair should be {⍺ ⍵} or {↑⍺ ⍵}, so that's possibly an acceptable reason for the much simpler getting in before other things
Was really just curious what the impetus was
@Adám Really? Is it all you suggesting new operators; are you the guy for that? Or others as well?
@dzaima Interesting...
@AviFS No:
      mask←1 0 0 0 1 0 0 ⋄ data←'AbcdEfg'
@Adám good example; and ⍣ has a similar issue, then
@Adám Hmmm...
There's also no clean workaround for some pair stuff afaik
      6 7 8(+⍮-)3
│9 10 11│3 4 5│
@AviFS Not just me. [John Scholes ](aplwiki.com/wiki/John_Scholes), Roger Hui, and Marshall Lochbaum all used to as well.
4:12 PM
But I guess {⍺⍵} isn't so bad
@AviFS {⍺⍵} is an idiom iirc
@dzaima Yeah, it is
@dzaima I give in
Alright, that's it from me @Adám. Thanks a bunch for everything!
@AviFS Well, we did add (which we'll treat in an upcoming Cultivation) which allows ,⍥⊂
@Adám True
OK, that's it for today then. See you in two weeks!
4:14 PM
See you then, thanks again!
And to be seen in one week for Seeds & live chat!
4:32 PM
CMC: you have n < 100 machines producing chocolate. All machines produce 100 gram chocolates except one machine that produces 101 gram choc. You want to find each one. for that you take i chocolates from machine i (from 1 to n) and add them together to S. Given S and n find the machine that produces 101 gram chocolate
@RGS S-100×+/⍳n
@Adám S←2016 ⋄ n←20 gives ¯16984
@RGS Maybe I don't understand the CMC. Shouldn't 20 good machines make S←100×+/⍳20?
Maybe I wasn't clear with what S is. S is the sum of all the weights of all the chocolates collected, knowing that I collect 1 chocolate from machine 1, 2 chocolates from machine 2, ..., n chocolates from machine n
And we know that all but one machine produce chocolate that weights 100 grams
@Adám uh wait, I got my maths wrong ahaha
@Adám yes that is it :P
Although 100|S works xD
@RGS I thought of that, but misread < as . Doh.
4:44 PM
I wrote the CMC with this in mind but turns out a plain | works
SE Chat search isn't very good at symbols. Neither are most search engines.
5:00 PM
@Adám I just read a file and got its contents in a vector but displaying it prints something which looks like a character matrix, which I think is the newlines making it print like that
but '\n'∊contents gives 0 0, which means \n isn't even an escaped newline
but I wanted to get a matrix where each row is a line of the file (don't mind extra spaces to pad short lines) and I used the first ⊆⌈ entry
5:38 PM
About half an hour ago I started writing a function to parse the mobiles from the last problem of the APL Competition into a nicer data structure. Sure, it is recursive, but I am surprised with how "easy" it was
But this was just parsing the mobile :P I have everything left to do ;)
6:01 PM
@RGS I should add an entry for getting file content as a vector of vectors: ⊃⎕NGET'path'1 which you can then mix to get a matrix.
@RGS I should add specific keywords (newline tabs etc.) to these.
@Adám ah this is exactly what I wanted :)
6:13 PM
Ah I think we already had this conversation here
wasn't Avi (?) one day trying to add rows to a (possibly empty) matrix?
6:27 PM
@RGS Sure was! Though I read the convo and can't figure out where the empty matrix & rows come in!
2 hours later…
8:39 PM
@AviFS reading my convo? I didn't talk about it yet. Can you link me to your conversation at the time?
@RGS I just mean the conversation between you & @Adám
That I didn't see the context
@RGS Seemed out the blue, as far as I could tell
So was just curious how I came up!
@RGS Does that answer the question?
8:55 PM
∧/(3 1×⍬⍴1⍴5) ≡ (3 1×1⍴5) ⍝ →1
(⍬⍴1⍴5) ≡ (1⍴5)           ⍝ →0 ?
@Wezl Singleton extension in the right side of the first expression.
Well apparently this works in ngn/apl, too
@Wezl ngn/apl also suffers from singleton extension.
@Marshall Suffers?
@Wezl It's pretty widely considered bad design. See for example the quoted passage here describing it as "permissive and infelicitous".
9:22 PM
@AviFS no xD i understood exactly that my messages seemed out of the blue, because they were. I was wondering if you could link to the conversation you had when you wanted to expand matrices by appending rows
@RGS Ah, I see!
May 29 at 15:49, by Avi F. S.
It's bothered me for a long time that one can't simply add another row to a vector with . I understand why, or so I think, one needs to do ⍪[.5] the first time around, and then one can continue doing plainly. But the inconsistent format makes it hard to, for instance, extend functions which are intended to create a matrix from an empty vector on row at a time.
Too funny that that conversation starts with the exact same thing I couldn't remember how to earlier today for Cultivation!
9:35 PM
still don't like overtaking ↑, but it's now the top slowest "thing", probably should just implement it:
@dzaima It really is awful to implement.
I'm going to try to put together some rules at some point so the prototype is something well-defined (and you get an error if you try to rely on it when it isn't) rather than just being a best effort.
@Marshall with the way i do things it shouldn't be too hard (make good impls for vectors and have "something" for high ranks) :p (i don't like idea of overtaking)
@dzaima I agree, but it seems to be too useful to get rid of. Maybe there is a cleaner way, but I haven't found it. Trying to use structural Under is too awkward.
(having a builtin for ↑⊸/⁼ would solve the issue with an empty result from /⁼ (and also maybe then /⁼ could be its monadic form?))
9:51 PM
@dzaima /⁼ is just ≠¨∘⊔, and we magically have the same problem. But overtaking makes complete sense, so it seems like at least that should be supported.
@Marshall right, is another annoying thing
@dzaima ↑⊸(/⁼)
I think if Take was like Reduce, where the monadic form guesses an identity element and the dyadic form lets you specify, then it would be less objectionable. Except in this case the "monadic" form has two arguments. J uses the fit conjunction !. to get a third one in but I'm not going to do that.
note that in order to be completely logical, an overtaken s items would need to have certain shapes which is mostly impossible with a "simple" prototype system
@Marshall There could be a function that lets you specify an array's type. The concern with that is that the type shouldn't really be an element but rather a collection of properties. Maybe you could actually set the type with asserts? That's a weird side effect channel though.
(also seems my impl for (≠𝕨)≠≠≢𝕩 is still very wrong)
10:03 PM
@dzaima Yes, the type system should support nesting at least. Probably also other things like numbers having a fixed value or different types for different columns (hyperplanes).
I want to make a markdown to html converter so my pages can automatically evaluate and color BQN snippets, and need an example of BQN code for people who like variable names and whitespace. These two birds seem to have aligned themselves nicely...
@AviFS thank you very much!!!
@RGS Anytime :)
(accidentally reminded myself that this still is a thing)
10:22 PM
What would be a good symbol to use for integration? Could go for ∫, but might want an additional symbol for definite integration. There are ∮∱⨑∲∳ according to wiki, but those apparently have specific meanings in different contexts (so don't want to overload/overwrite).
⸉ᔑ⑀∫ഽ🝡ϝ ... unicode is huge
@Moonchild the first, fourth and fifth are for integrations along a closed line. never seen the second/third; or maybe it's just too small for me to recognize
@Moonchild definite integration is the same symbol but with numbers in sub and superscript
@RGS right, in traditional notation it's like that. But for apl we want a consistent notation
@Moonchild of course. For APL the limits of the integral could be the left arg, for e.g.?
and no left arg means we want a primitive of the function instead of its definite integral
10:37 PM
Is integral an operator, or something else?
@Marshall I imagined indefinite integral as an operator, and definite integral as a composition
@RGS in regular apl, ambivalent operators are problematic
@Moonchild I see...
@Moonchild If you're integrating in 1D, I'd say just provide the indefinite form and let the user do the subtraction themselves. Although if you're intending to be a more serious CAS system then that prevents integrating functions that have singularities, so I guess you'd need both.
@RGS I have been tossing around ideas for an apl that allows for first-class ambivalent functions of any rank. But I'm not sure if it's a good idea
@Marshall I would like, ideally to make a full-on CAS. But it's not clear to me that's a practical thing to do; sagemath and octave are not on par with mathematica, and they're oss with lots of contributors
@Moonchild If you make the derived function ambivalent, you could have the left argument be the starting point, and no left argument mean any starting point as long as it's consistent.
@Moonchild Probably the number of people working on either one as a programming language rather than adding support for a particular field of mathematics is pretty small, though.
10:47 PM
@Marshall that causes problems if you want to do multiple integrals. Plus, it would be nice for indefinite integral of a function with a singularity to fail right away
@Marshall fair enough
@Moonchild Would it? If I integrate reciprocal I would expect to get logarithm, and then have it fail later if I call it on a non-positive argument.
@Marshall that's a property of the log function, though, not of the integration itself
I don't have anything to say about multiple integrals, at least for now. No idea how you'd fit them into a "functional" (calling things on other things) rather than symbolic context.
@Moonchild The idea is that you can usually consistently integrate between any two singularities. So I would say it's better to pick a region and give the indefinite integral limited to that region than to just fail outright.
@Moonchild Did you know that NARS2000 already has it?
@dzaima (10000↑1‿2 is a reasonable 0.0025ms avg now, 10000↑1‿0 being 350ns)
11:03 PM
Btw, the antiderivative (= indefinite integral) of any function is same as the definite integral from 0 (or any well-defined starting point for that function) to x, plus C
So there's not so much reason to consider the two separately
@Bubbler If your definite integral crosses a singularity, like the poles in the tangent function, then you should get an error as this integral isn't well-defined.
@Bubbler Integral may not be computable for some functions (or the algorithm for computing it may be prohibitively complex|expensive, or not yet discovered, or just not yet implemented). But you can approximate integral over a range by sampling points. That (sampling points) is what I mean by definite integral
@Moonchild Then do you mean symbolic integration? Why would you need that?
APL is not a CAS.
I want to make a CAS with APL syntax
APL was originally envisioned as mathematical notation that could also be executed
but there are things you can express (mathematically) in the notation, that the computer implementations can't handle. Like sums of infinite sequences (cf π ≡ 4×+/1,(¯1*⍳_)÷(1+2×⍳_))
But APL syntax isn't good for manipulating functions, so you'll need a way to represent mathematical expressions as an array-like entity. So differentiation and integration can be plain functions, as is an "evaluate the expression at certain x value(s)"
Then it might work.
cf. In Mathematica, if it fails to symbolically evaluate an integral, it leaves the whole expression as-is, so that it can still be numerically "evaluated"
11:22 PM
@Bubbler well, the idea is that, like in mathematica, integration (and other such features) would have to be interpreted in the interpreter itself. So they would have full access to the ast
01:00 - 16:0016:00 - 00:00

« first day (1266 days earlier)      last day (387 days later) »