« first day (1548 days earlier)      last day (1107 days later) » 

12:59 AM
"(0 2∊⍨10|⎕DR)" is probably littered in most APL applications to check if you have a character. It's too bad you have to use an each to get it to work on a vector (Unless someone has a smarter way of doing it I am unaware of?). I have rarely seen monadic ∊ (With ⎕ML < 1) used or encouraged. But i was able to shave seconds off code by using the Type Of primitive instead to test for characters
'      UniformRandomMixedVector ← {chars ← {⎕A[?⍨26]}¨⍳⍵ ⋄ nums ← ?⍨ ⍵ ⋄ (nums,chars)[?⍨2×⍵]}
      ⍴vec ← UniformRandomMixedVector 1e6
2000000
      ]runtime "(0 2∊⍨10|⎕DR)¨vec" "{⎕ML←0 ⋄ ~0⍷∊⍵}vec" -compare

  (0 2∊⍨10|⎕DR)¨vec  → 1.6E0  |   0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  {⎕ML←0 ⋄ ~0⍷∊⍵}vec → 7.5E¯1 | -54% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
The advantage of the ⎕DR approach is that it's generic enough that it just works for most people. With the type of primitive, you have to be more sure of what data types you're dealing with (It will fail if you have other objects like a namespace reference in the argument)
Wondering if I'm missing any other pitfalls about this alternative method for type checking. If no one can think of any, maybe we should suggest it as a faster approach for identifying character elements
 
Do you really need 0⍷? Why not 0= (or 0≠ or ' '= for that matter)?
 
⎕ml ← 0
⍴∊'abc'
3
      0≠ ∊ 1 'abc'
┌─┬─────┐
│0│1 1 1│
└─┴─────┘
You can do ' '= but you need to do a ⊃¨ which makes it just as slow
 
Oh, so it's a mixed vector of numbers and strings
 
' ' not '' above
@Bubbler Yup, using a simple = was my first wish as well
Just realizing how " ⍴∊'abc' " alone was probably the least helpful example I could've given lol
 
1:22 AM
Looks like scalar⍷ is optimized well enough and is optimal in this case
Using ≡¨ is slightly slower and {⎕IO⎕ML←0 ⋄ (,0)⍳∊⍵}vec roughly ties with it
 
Woah, (,0)⍳∊⍵ is such a cool variation of it. Nice
It is kinda funny/nice when you have someone who just started using APL and you see them have an expression that you can just look at at and say "that looks like Adam wrote it" and sure enough it comes from aplcart
So putting (fast) alternatives to algorithms on there is something we should keep doing, as more and more people are pulling from there
Although to be fair, this particular IsChar expression has been floating around in the community long before APLCart
 
 
3 hours later…
4:21 AM
@JoshD Maybe you'll support my efforts to have TypeOf reinstated as a primitive, using monadic ? Anyway, are you aware that it is equivalent to ⊃0⍴⊂ ?
 
 
2 hours later…
6:42 AM
Thanks for those PRs Adám and Rojer ;-)
We are getting the Pometo development moving again after a long pause for my new job...
 
 
3 hours later…
9:29 AM
@GordonGuthrie is there a specific APL you're trying to be compatible with? I only ask because it looks like you've kept the /⌿ as hybrids which if you have the choice I would separate
 
9:42 AM
{⍵/1}¨⍬
can someone explain to me why there are some empty lines printed?
when set ]box on
And it doesn't equal to .
 
RGS
10:05 AM
@LdBeth Empty arrays can sometimes look funky in Dyalog
Try ⎕SE.Dyalog.Utils.repObj {⍵/1}¨⍬
This ⎕SE.Dyalog.Utils.repObj gives you a code representation of its argument, so it help you see what empty arrays you are dealing with.
Now other people correct me if I'm wrong, but when Dyalog sees {⍵/1}¨⍬ it realises the result is going to be an empty array, but Dyalog goes ahead and builds a prototype of that empty array
And that prototype is an empty array that tries to emulate the structure and types of data you would have if the result were not empty
@LdBeth making any sense so far?
 
@LdBeth Consider using ]box on -s=max
Now compare the results of {⍵/1}¨n⍴0 with n set to 3 then 2 then 1 then 0.
 
RGS
@Adám :(
 
 
4 hours later…
1:46 PM
gonna miss the baa webinar today :(
 
Oh, thank you for reminding me of it!
 
oh yeah, last time Ray Polivka was asking about what sort of (APL) things would be good to show engineering students, and people were going to report back this week
so if you have any ideas, I'm sure he'd like to hear them
 
2:01 PM
minor nitpick: log -> new -> discard doesn't actually discard the log (it doesn't delete default.dlf so when you open up the ide again it loads that)
 
@rak1507 It doesn't promise to delete the file. It actually only clears what's in the window. If you then save the log, the file gets updated as usual.
 
oh, that's counter intuitive
 
What's actually wrong is the word "new". If it just said "clear", it'd be fine.
"New" implies that the old one is gone. "Clear" keeps the current one and just removes its content. If you don't save after that, well, then…
 
yeah
also the popup that says 'do you want to discard your current log', sounds pretty delete-y to me
 
@rak1507 Interestingly, the hint in the status bar does say "clear"!
@rak1507 Yeah, that should say "current Log contents", no?
 
2:12 PM
maybe, still sounds like it would delete it to me
 
How would you phrase it?
 
I would probably just make new delete the file, because I can't imagine someone wanting to clear the log but then restore it at a later date (and if they did, they could just copy it)
 
The default is to save the session when you quit APL.
 
yeah, I'm not sure then, it's probably fine as is tbh
maybe new -> clear and then that'll ... clear things up
 
@rak1507 I'll make 18.1 have "Clear". Thank you for bringing this up.
 
RGS
2:56 PM
      chars ← ' ▏▎▍▌▋▊▉█' ⋄ l ← 2
      chars[⌽∪⍉⌈\(l⍴≢chars)⊤⍳l*⍨≢chars]
That does NOT look good here, so try it in your session.
But is there a less wasteful way of building this pattern?
 
Announcement: BAA Webinar now. zoom.us/j/858532665 Passcode ← ×/1920 12 17
@RGS ⎕IO←0
 
RGS
@Adám ⍝ ⎕IO delenda est.
I keep forgetting to tell people that.
@RGS Yeah this definitely doesn't work, I need to build this pattern comfortably for l ← 100 at least.
 
@RGS {((⌊⍵÷c)⍴⊢/chars),chars⊃⍨⍵|⍨c←≢chars}⍤0⍳
 
RGS
3:20 PM
@Adám Thanks, I'll take a look :D
I did chars ← ⍪'▏▎▍▌▋▊▉█' ⋄ {new ← ⍺,⍨(≢⍺)⌿¯1↑⍵ ⋄ new⍪⍨⍵,' '}⍣5⍨chars
 
@RGS That's loopy!
 
RGS
@Adám It's recursive but makes a lot of sense!
Your ⍤0 doesn't count as loopy? :P
Tbf mine seems to be "less loopy" than yours, no? Mine recurses l times but your dfn is applied to l×≢chars in order to produce the same pattern.
 
3:36 PM
@RGS {chars[(1,⍨⌊⍵÷c)/⍤1⊢(c-1),⍵|⍨c←≢chars]}⍪ ― Better?
 
@Adám cool thanks
 
RGS
I just wanna know if mine is that bad despite having the ⍣ there.
 
Why doesn't this do what I want?
(0 0⍉m ← ∘.{(¯3↑⍺)≡(3↑⍵)} ⍨data)←0
SYNTAX ERROR
No matter how many (brackets) I put in.
 
that's just not something that one does
 
RGS
Sorry for the question, but what is it that you want it to do..?
 
3:44 PM
m ← ∘.{(¯3↑⍺)≡(3↑⍵)} ⍨data
(0 0⍉m) ← 0
^that works.
But I thought I could combine them.
 
@xpqz yeah, you can't truncate that to one expression
 
So -- create a matrix. Zero out the diag
@dzaima I came to that conclusion by trial and error, but I don't understand why not.
 
You need Under :-)
 
that's just how structural modification works - you must have some equivalent of (F assignable)←…
 
I need a drink.
 
3:46 PM
and you can't do (m←1)←2
 
you can use @ but it's not going to be very nice
or you could multiply it by an inverted identity matrix
 
yeah, with under you'd do m ← 0⍢(0 0∘⍉) ∘.…
 
I'm ok with the two-liner, just wanted to understand.
 
well, the thing to understand is that (m←…) is not an assignable expression (i believe that's called an lvalue in C terms, if that's something you've heard of)
 
aye
 
I'd never dream of doing that in C :) -- but C doesn't have the structural modification concept, full stop. But I see what you mean.
 
(and dzaima/APL because why not; note that dzaima/APL doesn't have structural modification)
 
RGS
@rak1507 (negated?)
 
not negated but ~ (hmm, - and ~ use the same word :/)
 
RGS
@rak1507 Well, certainly not an "inverted" id matrix, as the inverse of the id matrix is the matrix itself :P
 
3:57 PM
true
 
RGS
@rak1507 ah, I love being pedantic XD
 
I can tell :D
 
@RGS Are you fun at dinner parties?
jk
 
RGS
@xpqz at some :P
Are you having a dinner party with ppl from the Orchard?! If you invite me, I promise I'll behave
 
That might be fun.
 
RGS
4:00 PM
@Adám The "might" being conditional on how pedantic I am during the party? I already said I'll behave!
 
would have to serve apple themed dishes
 
RGS
@rak1507 oh I love apple pie and apple juice
 
pork and apple sauce for a main
 
RGS
That's the number #1 influence that The Netherlands had on me during my time there...
And we also need a salad with apple for the vegetarians
Not very imaginative, maybe there's a more interesting veggie dish w/ apple
 
This is a list of apple dishes, that use apple as a primary ingredient. Apple beverages are also included on this list. == Apple dishes == Æbleflæsk Apple butter Apple Charlotte Apple cheese Apple chips Apple cider Apple cider cookie Apple cobbler Apple crisp Apple crumble Apple dumpling Apple fritter Applejack Apple juice Apple pie Apple sauce Applesauce cake Apple soda Apple strudel Apple turnover Baked apple Brown Betty Calvados Calvados Roger Groult Candy apple Caramel apple Cider Cider doughnut Cobbler Eve's pudding German baked apples Ice Cider Jewish apple cake Međimurska gibanica Nièr...
 
4:12 PM
@Adám what was brian showing at the start of the webinar?
 
The SharpPlot wizard.
 
oh no, can't believe I missed that
oh well it'll be uploaded eventually
 
We're getting close to a year delay for that…
 
takes time for the carrier pigeons to fly to the youtube headquarters
 
4:20 PM
that's horrible!
 
@Marshall given that this works, that's not really related
that's really the same as namespace.x←1 in APL, which will work for any expression giving a namespace in place of namespace
 
That's a good explanation of the difference. In APL you're assigning to a name, which usually can't be computed, while in C you're writing to a pointer, which can. But a namespace can be part of a name and can be computed.
 
@RGS No loops: {c←≢chars ⋄ d←⌊⍵÷c ⋄ m←1+⊢⌿d ⋄ chars[(m,⍨≢⍵)⍴(d,1,m-d+1)/⍥,(c-1),(c|⍵),0]}⍪
 
@dzaima Ah yes, I think this is why I thought it might work:
(params←⎕NS⍬).(include_docs limit)←'true' 3
 
yeah, (something returning a namespace).names always is an "lvalue" and so can be assigned. There's really no real reason (m←1) couldn't be an lvalue (besides it making things more complicated for approximately zero gain)
 
4:32 PM
Ah well, every day is a school day.
Thanks.
 
5:01 PM
@RGS @Adám thank you, it's now clear. I almost forgot there's a verbose mode for printing arrays.
 
I would highly recommend using fns=on with boxing too, means ⎕← displays with boxing
 
ngn
@user41805 thanks for the bounty!
 
5:30 PM
ns←⎕NS⍬
ns.(x y)←10 20
ns.(x y)←ns.(y x)
Is there a way to do this ↑ inside a function, specifying variable names as text vectors, without execute?
Okay you can sort of do it in a tradfn, but not in a dfn maybe
ok no maybe not
 
 
1 hour later…
6:41 PM
@RikedyP 'ns'⎕NS names
 
@Adám but you also need to assign to that
the thing being done is swapping two namespace fields
 
Oh, I missed the swap.
 
 
1 hour later…
RGS
7:52 PM
@Adám nice one
 

« first day (1548 days earlier)      last day (1107 days later) »