2 estr - represent some types of value by text strings
8 x null, string, real or complex number, list, matrix,
9 object. block, named block, error
14 This function attempts to represent x exactly by a string s of
15 ordinary text characters such that eval(s) == x.
17 If x is null, estr(x) returns the string "".
19 If x is a string, estr(x) returns the string in which occurrences of
20 newline, tab, ", \, etc. have been converted to \n, \t, \",
21 \\, etc., '\0' to \000 or \0 according as the next character is
22 or is not an octal digit, and other non-text characters to their
23 escaped hex representation, e.g. char(165) becomes \xa5.
25 For real x, estr(x) represebts x in fractional mode.
29 ; estr("abc\0xyz\00023\n\xa5\r\n")
30 ""abc\0xyz\00023\n\xa5\r\n""
33 ; estr(mat[3] = {2, list(3,5), "abc"})
34 "mat[3]={2,list(3,5),"abc""
45 ## Copyright (C) 2006 Ernest Bowen
47 ## Calc is open software; you can redistribute it and/or modify it under
48 ## the terms of the version 2.1 of the GNU Lesser General Public License
49 ## as published by the Free Software Foundation.
51 ## Calc is distributed in the hope that it will be useful, but WITHOUT
52 ## ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
53 ## or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General
54 ## Public License for more details.
56 ## A copy of version 2.1 of the GNU Lesser General Public License is
57 ## distributed with calc under the filename COPYING-LGPL. You should have
58 ## received a copy with calc; if not, write to Free Software Foundation, Inc.
59 ## 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
61 ## @(#) $Revision: 30.1 $
62 ## @(#) $Id: estr,v 30.1 2007/03/16 11:10:42 chongo Exp $
63 ## @(#) $Source: /usr/local/src/cmd/calc/help/RCS/estr,v $
65 ## Under source code control: 2006/08/20 14:45:13
66 ## File existed as early as: 2006
68 ## chongo <was here> /\oo/\ http://www.isthe.com/chongo/
69 ## Share and enjoy! :-) http://www.isthe.com/chongo/tech/comp/calc/