« first day (1060 days earlier)      last day (1595 days later) » 

12:59 PM
In Dyalog APL, in a .Net Class, I can add :Attribute to a class, and to a method, but it doesn't look like I can add an attribute to a Field (property in C#); is that possible?
I have a working proof-of-concept PowerShell Cmdlet in APL now :) but it can only output some data; to get a Cmdlet which can accept input requires its class to have public properties with "ParameterAttribute" attributes; adding :Attribute ParameterAttribute after the field declaration does not error, but does not emit any related CIL code to the assembly dll either
 
1:11 PM
Proof of concept code / instructions: gist.github.com/HumanEquivalentUnit/…
:)
 
2:05 PM
In help.dyalog.com/17.1/#UNIX_IUG/… it says that Dyalog can be used to run scripts. But it does not go into detail on how and i was unable to do it with mapl. Does anyone have experience with this?
 
2:43 PM
@rcabaco there was discussion about it here. tl;dr cat file | dyalog -script
 
@dzaima thank you
 
3:09 PM
Interesting behaviour for ⎕SH:
⎕SH 'ps -u rcabaco'
works as expected
⎕SH'echo -e "\033[2J"'
echoes "-e \033[2J"
it seems ⎕SH gives the arguments of the command as a quoted string. conflicts with echo
 
@rcabaco that echoes -e ⌷[2J for me
but indeed interesting. i feel like something like ⎕sh 'echo' '-e' 'hello' should be possible
 
i tried that too
i wanted to clear the terminal screen at the top of the script, hence all this.
 
 
5 hours later…
8:48 PM
Is there a way to sort a simple list in a train?
(so not using [ ] for indexing with ⍋)
 
@EdgyNerd not really, in regular Dyalog. Extended has & , and dzaima/APL has < & > (and in both ⍋⊇⊢ works)
actually, there is ⊂∘⍋⌷⊢
 
@dzaima how does that work?
 
@EdgyNerd (⊂A)⌷B works approximately like B[A] or something, idk ¯\_(ツ)_/¯
so , with a vector as the left arg acts like bracket indexing, the vectors items being separated by semicolons. example
 
oh ok
 
 
1 hour later…
10:13 PM
I wrote this piece on squad indexing a little while ago: optima-systems.co.uk/… (definitely not self-promotion ;D)
Was toying around with the idea of cube[1;2;] which can be done using squad indexing, and cube[1;;3] which can't.
*to the best of my knowledge at least
 
@JamesHeslip Well, it needs either bracket axes or multiple applications with .
⋄ A←3 3 3⍴⎕A ⋄ ⎕←A[1;;3] ⋄ ⎕←1 3⌷[1 3]A ⋄ ⎕←1⌷3⌷⍤1⊢A
 
@Adám
CFI
CFI
CFI
 
@JamesHeslip I got this idea for an Axes operator which would take a function and two arguments, and then apply the left arguments along the axes of the right argument.
 
Can you compare the runtime of those statements? I'm on my phone, pretty difficult for me
 
⋄ ⎕SE.A←3 3 3⍴⎕A ⋄ ⎕←⎕SE.cmpx 'A[1;;3]' '1 3⌷[1 3]A' '1⌷3⌷⍤1⊢A'
 
10:21 PM
@Adám
  A[1;;3]    → 3.9E¯7 |    0% ⎕⎕⎕⎕⎕⎕⎕⎕⎕
  1 3⌷[1 3]A → 5.8E¯7 |  +45% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
  1⌷3⌷⍤1⊢A   → 1.7E¯6 | +327% ⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕⎕
 
So it isn't that it is not doable, but rather that the performance is bad.
 
I feel like if you have to use square brackets to specify axis on a squad operation, you may as well have used square bracket indexing
But thank you :)
Your axes operator sounds interesting. Do you have an example of where you might use it?
 
Oh yes, I'm with you on that. All this was discussed in the comments to your article. Well, we could (not saying we should) add something like ¯1 to mean all. Then you'd be able to do 1 ¯1 3⌷
@JamesHeslip Sure, e.g. if you have a 3-by-4 matrix and want the first and last row, and first, second and fourth column, you'd do (1 0 1)(1 1 0 1)⌿Axes matrix
 
Ah, gotcha.
 
And replace by ⊂[1] to cut the matrix into six pieces:
⎕←↑(⊂1 1 0 1)⊂¨(1 0 1)⊂[1]3 4⍴⎕A
 
10:29 PM
@Adám
┌─┬──┬─┐
│A│BC│D│
│E│FG│H│
├─┼──┼─┤
│I│JK│L│
└─┴──┴─┘
 
However, it doesn't solve the problem of skipping axes, instead relying on the function having a left argument that allows skipping, e.g. 1 for and ,1 for ⊂[1] (with my proposed extension).
 

« first day (1060 days earlier)      last day (1595 days later) »