On 10/5/18 3:15 PM, Ralph Mellor wrote:
Well I guess my first way of explaining it was a complete bust. :)

It's not going to be worth me discussing your reply to my first attempt.

List context means that something appears in the context of a list.

For example, given the list of characters EEEEAEEEE, A appears
in the context of a list of 9 characters.

Flattening a list means creating a new list from an old list such
that any scalar items in the old list are just copied into the new
list and any inner list items in the old list are copied one element
at a time into the new list.

In code:

 >  1 ,2, [3,4], 5, 6
( 1 2 [3 4] 5 6)

shows that the resulting list is 5 elements, with the third being
the single list [3,4] because it does *not* flatten in list context.

In contrast, in:

 >  1 ,2, |[3,4], 5, 6
( 1 2 3 4 5 6)

we get 6 elements instead because the `|` makes its right hand
side argument flatten into the list context in which it appears.

I won't be surprised to hear that's left you more confused, not less.

If so it'll be time for someone else to try and explain it. :)

--
raiph

Hi Raiph,

I understand now.  Thank you!

-T

Reply via email to