Re: [stack] Jon Purdy: Why Concatenative Programming Matters
eas lab <[email protected]> Tue, 14 Feb 2012 07:01:36 +0200
| Newsgroups | gmane.comp.lang.concatenative |
|---|---|
| Message-ID | <CAN3-DLEMV2SGzcpDBQGFT_HkK_saR+ZeXCuR_btYXY_iz8uxBw@mail.gmail.com> |
This commentor appropriately acknowledges the important cognitive-load aspect:- ]the code was always *intensely* write-only since you had to have a ]mental model of exactly what was on the stack where to even hope to ]follow it. *nix piping is beautifully simple yet powerfull, since the stack only contains "it" [the previous output]. So that at each/every stage, you only need to know about your single-supplier. ] 2 :: FAA. (A) -> (A, int) ] 3 :: FAB. (B) -> (B, int) ok ] We match up the types: ] ] (A, int) = (B) ?! does this mean 'assume they match and see what that implies'? ------------- Apparently, if the output of stageN includes item/s in addition to what stageN+1 needs, they can be left on the stack for stageN+2. But he and Haskell/monads seems to 'wrap' the extra item/s and pass it on, and imply that some automagic relieves you from the mental load of remembering what was left on the stack for all possible combinations of stages afterN+1 ?