From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7226 invoked by alias); 9 Nov 2016 18:08:10 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 22104 Received: (qmail 5505 invoked from network); 9 Nov 2016 18:08:10 -0000 X-Qmail-Scanner-Diagnostics: from aurora-borealis.phear.org by f.primenet.com.au (envelope-from , uid 7791) with qmail-scanner-2.11 (clamdscan: 0.99.2/21882. spamassassin: 3.4.1. Clear:RC:0(94.242.255.80):SA:0(-1.7/5.0):. Processed in 0.258652 secs); 09 Nov 2016 18:08:10 -0000 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.7 required=5.0 tests=MISSING_HEADERS, RP_MATCHES_RCVD,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.1 X-Envelope-From: khatar@phear.org X-Qmail-Scanner-Mime-Attachments: | X-Qmail-Scanner-Zip-Files: | Received-SPF: pass (ns1.primenet.com.au: SPF record at phear.org designates 94.242.255.80 as permitted sender) X-Virus-Scanned: amavisd-new at phear.org Date: Wed, 9 Nov 2016 18:02:20 +0000 From: khatar@phear.org Cc: zsh-users@zsh.org Subject: would it be nice to support =<< ? (not the haskell one) Message-ID: <20161109180219.GA28703@aurora-borealis.phear.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit User-Agent: Mutt/1.5.23 (2014-03-12) hello people, this is a script to render some json elements json_elements=() read json_elements\[1+$#json_elements] <<. { "user": "$USER", "uid": "$UID" } . read json_elements\[1+$#json_elements] <<. { "user": "$USER", "uid": "$UID" } . print "[ ${(j: ,:)json_elements} ]" the thing is read json_elements\[1+$#json_elements] <<. is quiet hard to read and i really miss syntaxes like the perl qq() or the ruby %Q. would it be possible to get a would it be smart? i was thinking of a =<< operator so we could write element=<<. { "user": "$USER", "uid": "$UID" } . instead of read element <<. { "user": "$USER", "uid": "$UID" } . this would be very convenient to replace this read json_elements\[1+$#json_elements] <<. { "user": "$USER", "uid": "$UID" } . by json_elements+=<<. { "user": "$USER", "uid": "$UID" } . but is it smart? is it possible? regards