Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Append (,) work?

Tags:

j

Append , says:

x,y appends items of y to items of x after:

  1. Reshaping an atomic argument to the shape of the items of the other,
  2. Bringing the arguments to a common rank (of at least 1) by repeatedly itemizing (,:) any of lower rank, and
  3. Bringing them to a common shape by padding with fill elements in the manner described in Section II B.

What is meant by 1.? Doesn't step 2. and 3. do this? Could 1. be removed from the list and the result would still be the same (I assume it cannot but like to understand why)?

like image 715
Micha Wiedenmann Avatar asked Feb 13 '26 09:02

Micha Wiedenmann


1 Answers

  1. Reshaping an atomic argument to the shape of the items of the other,

This step will repeat an argument, if it is atomic, which is different from "padding with fill elements" (of step 3.). Compare the scalar 5 with the list 1$5 (i.e. a list of one element):

NB. scalar 5, atomic case (step 1. applies), argument is repeated
   (i. 2 3), 5
0 1 2
3 4 5
5 5 5

NB. list 1$5, non-atomic case (step 2. and 3. apply), argument is padded
   (i. 2 3), 1$5
0 1 2
3 4 5
5 0 0
like image 166
Micha Wiedenmann Avatar answered Feb 22 '26 09:02

Micha Wiedenmann



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!