2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								! Copyright (C) 2006 Chris Double. 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								! See http://factorcode.org/license.txt for BSD license. 
							 
						 
					
						
							
								
									
										
										
										
											2015-01-02 13:39:14 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								USING:  json  help.markup  help.syntax  kernel  ;
 
							 
						 
					
						
							
								
									
										
										
										
											2008-01-14 16:42:21 -05:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								IN:  json.writer 
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 23:49:17 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  >json 
							 
						 
					
						
							
								
									
										
										
										
											2014-05-23 23:20:15 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $values { "obj"  object  } { "string"  "the object converted to JSON format"  } }
							 
						 
					
						
							
								
									
										
										
										
											2015-07-02 13:31:22 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $description "Serializes the object into a JSON formatted string."  }
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $see-also json-print } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 23:49:17 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								HELP:  json-print 
							 
						 
					
						
							
								
									
										
										
										
											2014-05-23 23:20:15 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $values { "obj"  object  } }
							 
						 
					
						
							
								
									
										
										
										
											2014-11-28 11:11:21 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $description "Serializes the object into a JSON formatted string and outputs it to the standard output stream." 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								$nl
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"Some options can control the formatting of the result:" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $table
							 
						 
					
						
							
								
									
										
										
										
											2014-11-28 19:36:07 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								     { { $link json-allow-fp-special? } "Allow special floating-points: NaN, Infinity, -Infinity"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								     { { $link json-friendly-keys? }    "Convert - to _ in tuple slots and hashtable keys"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								     { { $link json-coerce-keys? }      "Coerce hashtable keys into strings"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								     { { $link json-escape-slashes? }   "Escape forward slashes inside strings"  }
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								     { { $link json-escape-unicode? }   "Escape unicode values inside strings"  }
							 
						 
					
						
							
								
									
										
										
										
											2014-11-28 11:11:21 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								}
							 
						 
					
						
							
								
									
										
										
										
											2007-09-20 18:09:08 -04:00 
										
									 
								 
							 
							
								
							 
							
								 
							 
							
							
								{ $see-also >json } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2015-01-02 13:39:14 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ json-fp-special-error json-allow-fp-special? } related-words
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								HELP:  json-fp-special-error 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								{ $error-description "Thrown by "  { $link "json.writer"  } " when attempting to serialize -1/0. or +1/0. or NaN when "  { $link json-allow-fp-special? } " is not enabled."  } ;
 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 23:49:17 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								ARTICLE: "json.writer"  "JSON writer" 
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								"The "  { $vocab-link "json.writer"  } " vocabulary defines words for converting objects to JSON format." 
							 
						 
					
						
							
								
									
										
										
										
											2009-10-01 15:56:36 -04:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								{ $subsections
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    >json
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								    json-print
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								} ;
 
							 
						 
					
						
							
								
									
										
										
										
											2008-11-14 23:49:17 -05:00 
										
									 
								 
							 
							
								
									
										 
									 
								
							 
							
								 
							 
							
							
								
							 
						 
					
						
							
								
							 
							
								
							 
							
								 
							 
							
							
								ABOUT: "json.writer"