Why Nostr? What is Njump?
2025-04-29 03:08:29
in reply to

Ray Lee on Nostr: nprofile1q…r59k6 Sometimes this operation is called flatten, where an argument with ...

Sometimes this operation is called flatten, where an argument with some composite structure is linearized into an array which can be included inline. A sibling operator is graft, where the structure of the argument is preserved when included in its parent.

These pop up in a lot of languages as native operations, or hand-written functions if missing. The language Go has a limited form of this spelled `...` for expanding an array-like object when calling a variadic function, or when appending items. Javascript has a reverse version of this operator termed destructuring, where an array-like thing is broken out into individual variables.

In my experience this mapping -- or impedence matching -- of structures to other forms happens a lot in code. I suspect there's a uniform description of this in the the PLT world, but I'm afraid I have a gap around those topics.
Author Public Key
npub1z3gcv7de6j56w0ze79kr2ghtp5zcq8yhywa996gg9y6zexymx9gspvlfqv