Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
would it be nice to support =<< ? (not the haskell one)
- X-seq: zsh-users 22104
- From: khatar@xxxxxxxxx
- Subject: would it be nice to support =<< ? (not the haskell one)
- Date: Wed, 9 Nov 2016 18:02:20 +0000
- Cc: zsh-users@xxxxxxx
- List-help: <mailto:zsh-users-help@zsh.org>
- List-id: Zsh Users List <zsh-users.zsh.org>
- List-post: <mailto:zsh-users@zsh.org>
- Mailing-list: contact zsh-users-help@xxxxxxx; run by ezmlm
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
Messages sorted by:
Reverse Date,
Date,
Thread,
Author