Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: would it be nice to support =<< ? (not the haskell one)



On Wed, Nov 9, 2016 at 10:02 AM,  <khatar@xxxxxxxxx> wrote:
>
> i was thinking of a =<< operator so we could write
>
>         element=<<.
>                 { "user": "$USER", "uid": "$UID" }
>         .


You can do this:

    element=$(<<.
        { "user": "$USER", "uid": "$UID" }
    .
    )

This is handled efficiently, with a minimum of forking.  Note that
it's necessary to follow the end marker with a newline before adding
the closing paren.



Messages sorted by: Reverse Date, Date, Thread, Author