eiffelhub/json — pull request #7 by ynh (2013-09-24 19:59:49+00:00)
Title: Simplify the json object by adding type specific put and replace

While creating objects of the type JSON_OBJECT, I was forced to write redundant code. This could be avoided by creating a put/replace procedure for each data type (STRING, INTEGER, NATURAL and REAL).

modal.put (create {JSON_STRING}.make_json("start_modal"), "type")
modal.put (create {JSON_STRING}.make_json(url), "url")
modal.put (create {JSON_STRING}.make_json(title), "title")

This code could be replaced with

modal.put_string ("start_modal") "type")
modal.put_string (url, "url")
modal.put_string (title, "title")

Which is much easier to read.