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

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



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