zsh-users
 help / color / mirror / code / Atom feed
* would it be nice to support =<< ? (not the haskell one)
@ 2016-11-09 18:02 khatar
  2016-11-09 19:27 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: khatar @ 2016-11-09 18:02 UTC (permalink / raw)
  Cc: zsh-users

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

























^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2016-11-10 16:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-11-09 18:02 would it be nice to support =<< ? (not the haskell one) khatar
2016-11-09 19:27 ` Bart Schaefer
2016-11-10  8:15   ` khatar
2016-11-10 16:44     ` Bart Schaefer

Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).