« first day (1039 days earlier)      last day (1912 days later) » 

09:44
the above behaviour it seems ok to me
if the result is zilde as void set
for {⍵=1}¨⍬
10:23
@RosLuP yeah, the output is still gonna have length 0, but the function is still processed
11:01
That make unuseful the = operation, because it is not = of sets... If zilde is different of B with operation ≡ it is wrong and unuseful that symbol too ... The = for sets in math is defined as W=B <=> (Ax xeW=>xeB)/(Ax xeB=>xeW)
Void set has not a type (or all the types), it is a list and a set too I would say
 
1 hour later…
ngn
ngn
12:06
@RosLuP apl is like linear algebra, not set theory
 
1 hour later…
13:16
The same, for me void set=void list that has no type (or type void set and list)
@dzaima @ngn ^
Than = of list is different of = list
ngn
ngn
@RosLuP an apl array is not just content. it's more like a triple of (type; shape; content), and the order of elements everywhere is significant
the reason we have = and ≡ as separate functions is that = is often useful as an arithmetic operation, penetrating to the scalars just like +, ×, etc do
we call ≡ "match" instead of "equal". it compares all three components - type, shape, and content.
in the case of empty arrays, we consider content to consist of a single prototypical element - those are also taken into consideration by ≡
13:54
Better to say "this is a void list" than "this is the list of this type shape and 0 elements" or "this list has content 0 elements"
In 90% of golf exercises what people want to see it is the void list, but one has to show the void list of type ....
In the edge or limit cases
@ngn
 
2 hours later…
ngn
ngn
16:19
@RosLuP i agree, it would be simpler and therefore better to be able to say just "this is a void list"
(though i've never had any objections against typed empty results from my golfing programs)
but consider also the opposite - what if your input is empty without any information about type, shape, or prototypical content?
task: given a list of debit-credit pairs, check if the books are balanced, i.e. report whether the sum of debits equals the sum of credits
even for a simple task like ^this you wouldn't be able to write the obvious solution =/⊃+/⎕ because it requires a special case for empty input
another example: surround a string with spaces, {¯1⌽⍵↑⍨2+⍴⍵}. if '' is indistinguishable from , you might get 0 0 instead of ' ' when the input is void
 
4 hours later…
20:56
@ngn if this function would be something as ∧/{=/⍵}¨(1 1)(3 3) than ∧/{=/⍵}¨ /voidlist is one error in every type of voidlist or for me it has return 1 for voidlist for each type
21:46
For the second function I not would write it for what I know because ⍵↑/voidset it should be voidset . So ⍵↑zilde for me it is not zilde omega times but just zilde (because it is not so I will not use that)
@RosLuP then this is just opinion. I think 10↑'' being spaces can be useful (and I definitely think it shouldn't just return in any case), you may not.
I think that cold be v/ void set and /\/ void set could be ok for return 1 or true
In other word reduce and of void set, and reduce or of void set could be 1
Both
@dzaima I prefer follow mathematics and set theory...if in a set of 5 element I want 10 elements that is one error
@RosLuP but others prefer being able to write code in a certain way.
or if the operation is "want at last 10 elements" it could return 5 elements
@RosLuP it could. My apl errors in this case
22:02
Yes @ngn could be right in one modified 2th example... So retain the type even in a void list could be ok ...
@dzaima so it is better have error or not? For me should be better have error
@RosLuP it depends. There's no "better" or "worse" here
Yes it is better if can describe many situation in one side, or can catch errors in the other side ... There is one side better, where all is easier
@RosLuP I can describe infinite cases where erroring is better, and infinite where padding is better. is ∞>∞ or ∞<∞?
at some point i might change my to make 4↑1 2 give 1 2 0 0 etc but who knows
22:18
For that there is 4 rho 1 2
Already
So I would write the 2th example of @ngn as {¯1⌽⍵⍴⍨2+⍴⍵}
@RosLuP 4⍴1 2 is 1 2 1 2, not 1 2 0 0
Ok I remember it wrong
1 2,2rho0
For above {¯1⌽⍵,2⍴' '}
That function is ok with zilde and for '' too
That function return for zilde as '' 2 spaces

« first day (1039 days earlier)      last day (1912 days later) »