diff options
| author | Richard M. Stallman | 1993-03-10 05:14:04 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1993-03-10 05:14:04 +0000 |
| commit | 6315e7617b69afe2eb1808021f6f8263c6367cb9 (patch) | |
| tree | e5e878bb1fe1af055a0deb13f8cb594d1fef4bc0 /src/data.c | |
| parent | f5313ed94c3c7bc4ca1a1c64e6e6d61f21f6604a (diff) | |
| download | emacs-6315e7617b69afe2eb1808021f6f8263c6367cb9.tar.gz emacs-6315e7617b69afe2eb1808021f6f8263c6367cb9.zip | |
(syms_of_data) [LISP_FLOAT_TYPE]: Define new error conditions:
Qarith_error, Qrange_error, Qdomain_error,
Qsingularity_error, Qoverflow_error, Qunderflow_error.
Diffstat (limited to 'src/data.c')
| -rw-r--r-- | src/data.c | 79 |
1 files changed, 63 insertions, 16 deletions
diff --git a/src/data.c b/src/data.c index 20a28bee2b5..fe71c6768cb 100644 --- a/src/data.c +++ b/src/data.c | |||
| @@ -49,6 +49,9 @@ Lisp_Object Qbuffer_or_string_p; | |||
| 49 | Lisp_Object Qboundp, Qfboundp; | 49 | Lisp_Object Qboundp, Qfboundp; |
| 50 | Lisp_Object Qcdr; | 50 | Lisp_Object Qcdr; |
| 51 | 51 | ||
| 52 | Lisp_Object Qrange_error, Qdomain_error, Qsingularity_error; | ||
| 53 | Lisp_Object Qoverflow_error, Qunderflow_error; | ||
| 54 | |||
| 52 | #ifdef LISP_FLOAT_TYPE | 55 | #ifdef LISP_FLOAT_TYPE |
| 53 | Lisp_Object Qfloatp; | 56 | Lisp_Object Qfloatp; |
| 54 | Lisp_Object Qnumberp, Qnumber_or_marker_p; | 57 | Lisp_Object Qnumberp, Qnumber_or_marker_p; |
| @@ -1833,6 +1836,8 @@ DEFUN ("lognot", Flognot, Slognot, 1, 1, 0, | |||
| 1833 | void | 1836 | void |
| 1834 | syms_of_data () | 1837 | syms_of_data () |
| 1835 | { | 1838 | { |
| 1839 | Lisp_Object error_tail, arith_tail; | ||
| 1840 | |||
| 1836 | Qquote = intern ("quote"); | 1841 | Qquote = intern ("quote"); |
| 1837 | Qlambda = intern ("lambda"); | 1842 | Qlambda = intern ("lambda"); |
| 1838 | Qsubr = intern ("subr"); | 1843 | Qsubr = intern ("subr"); |
| @@ -1884,10 +1889,12 @@ syms_of_data () | |||
| 1884 | 1889 | ||
| 1885 | Qcdr = intern ("cdr"); | 1890 | Qcdr = intern ("cdr"); |
| 1886 | 1891 | ||
| 1892 | error_tail = Fcons (Qerror, Qnil); | ||
| 1893 | |||
| 1887 | /* ERROR is used as a signaler for random errors for which nothing else is right */ | 1894 | /* ERROR is used as a signaler for random errors for which nothing else is right */ |
| 1888 | 1895 | ||
| 1889 | Fput (Qerror, Qerror_conditions, | 1896 | Fput (Qerror, Qerror_conditions, |
| 1890 | Fcons (Qerror, Qnil)); | 1897 | error_tail); |
| 1891 | Fput (Qerror, Qerror_message, | 1898 | Fput (Qerror, Qerror_message, |
| 1892 | build_string ("error")); | 1899 | build_string ("error")); |
| 1893 | 1900 | ||
| @@ -1897,80 +1904,120 @@ syms_of_data () | |||
| 1897 | build_string ("Quit")); | 1904 | build_string ("Quit")); |
| 1898 | 1905 | ||
| 1899 | Fput (Qwrong_type_argument, Qerror_conditions, | 1906 | Fput (Qwrong_type_argument, Qerror_conditions, |
| 1900 | Fcons (Qwrong_type_argument, Fcons (Qerror, Qnil))); | 1907 | Fcons (Qwrong_type_argument, error_tail)); |
| 1901 | Fput (Qwrong_type_argument, Qerror_message, | 1908 | Fput (Qwrong_type_argument, Qerror_message, |
| 1902 | build_string ("Wrong type argument")); | 1909 | build_string ("Wrong type argument")); |
| 1903 | 1910 | ||
| 1904 | Fput (Qargs_out_of_range, Qerror_conditions, | 1911 | Fput (Qargs_out_of_range, Qerror_conditions, |
| 1905 | Fcons (Qargs_out_of_range, Fcons (Qerror, Qnil))); | 1912 | Fcons (Qargs_out_of_range, error_tail)); |
| 1906 | Fput (Qargs_out_of_range, Qerror_message, | 1913 | Fput (Qargs_out_of_range, Qerror_message, |
| 1907 | build_string ("Args out of range")); | 1914 | build_string ("Args out of range")); |
| 1908 | 1915 | ||
| 1909 | Fput (Qvoid_function, Qerror_conditions, | 1916 | Fput (Qvoid_function, Qerror_conditions, |
| 1910 | Fcons (Qvoid_function, Fcons (Qerror, Qnil))); | 1917 | Fcons (Qvoid_function, error_tail)); |
| 1911 | Fput (Qvoid_function, Qerror_message, | 1918 | Fput (Qvoid_function, Qerror_message, |
| 1912 | build_string ("Symbol's function definition is void")); | 1919 | build_string ("Symbol's function definition is void")); |
| 1913 | 1920 | ||
| 1914 | Fput (Qcyclic_function_indirection, Qerror_conditions, | 1921 | Fput (Qcyclic_function_indirection, Qerror_conditions, |
| 1915 | Fcons (Qcyclic_function_indirection, Fcons (Qerror, Qnil))); | 1922 | Fcons (Qcyclic_function_indirection, error_tail)); |
| 1916 | Fput (Qcyclic_function_indirection, Qerror_message, | 1923 | Fput (Qcyclic_function_indirection, Qerror_message, |
| 1917 | build_string ("Symbol's chain of function indirections contains a loop")); | 1924 | build_string ("Symbol's chain of function indirections contains a loop")); |
| 1918 | 1925 | ||
| 1919 | Fput (Qvoid_variable, Qerror_conditions, | 1926 | Fput (Qvoid_variable, Qerror_conditions, |
| 1920 | Fcons (Qvoid_variable, Fcons (Qerror, Qnil))); | 1927 | Fcons (Qvoid_variable, error_tail)); |
| 1921 | Fput (Qvoid_variable, Qerror_message, | 1928 | Fput (Qvoid_variable, Qerror_message, |
| 1922 | build_string ("Symbol's value as variable is void")); | 1929 | build_string ("Symbol's value as variable is void")); |
| 1923 | 1930 | ||
| 1924 | Fput (Qsetting_constant, Qerror_conditions, | 1931 | Fput (Qsetting_constant, Qerror_conditions, |
| 1925 | Fcons (Qsetting_constant, Fcons (Qerror, Qnil))); | 1932 | Fcons (Qsetting_constant, error_tail)); |
| 1926 | Fput (Qsetting_constant, Qerror_message, | 1933 | Fput (Qsetting_constant, Qerror_message, |
| 1927 | build_string ("Attempt to set a constant symbol")); | 1934 | build_string ("Attempt to set a constant symbol")); |
| 1928 | 1935 | ||
| 1929 | Fput (Qinvalid_read_syntax, Qerror_conditions, | 1936 | Fput (Qinvalid_read_syntax, Qerror_conditions, |
| 1930 | Fcons (Qinvalid_read_syntax, Fcons (Qerror, Qnil))); | 1937 | Fcons (Qinvalid_read_syntax, error_tail)); |
| 1931 | Fput (Qinvalid_read_syntax, Qerror_message, | 1938 | Fput (Qinvalid_read_syntax, Qerror_message, |
| 1932 | build_string ("Invalid read syntax")); | 1939 | build_string ("Invalid read syntax")); |
| 1933 | 1940 | ||
| 1934 | Fput (Qinvalid_function, Qerror_conditions, | 1941 | Fput (Qinvalid_function, Qerror_conditions, |
| 1935 | Fcons (Qinvalid_function, Fcons (Qerror, Qnil))); | 1942 | Fcons (Qinvalid_function, error_tail)); |
| 1936 | Fput (Qinvalid_function, Qerror_message, | 1943 | Fput (Qinvalid_function, Qerror_message, |
| 1937 | build_string ("Invalid function")); | 1944 | build_string ("Invalid function")); |
| 1938 | 1945 | ||
| 1939 | Fput (Qwrong_number_of_arguments, Qerror_conditions, | 1946 | Fput (Qwrong_number_of_arguments, Qerror_conditions, |
| 1940 | Fcons (Qwrong_number_of_arguments, Fcons (Qerror, Qnil))); | 1947 | Fcons (Qwrong_number_of_arguments, error_tail)); |
| 1941 | Fput (Qwrong_number_of_arguments, Qerror_message, | 1948 | Fput (Qwrong_number_of_arguments, Qerror_message, |
| 1942 | build_string ("Wrong number of arguments")); | 1949 | build_string ("Wrong number of arguments")); |
| 1943 | 1950 | ||
| 1944 | Fput (Qno_catch, Qerror_conditions, | 1951 | Fput (Qno_catch, Qerror_conditions, |
| 1945 | Fcons (Qno_catch, Fcons (Qerror, Qnil))); | 1952 | Fcons (Qno_catch, error_tail)); |
| 1946 | Fput (Qno_catch, Qerror_message, | 1953 | Fput (Qno_catch, Qerror_message, |
| 1947 | build_string ("No catch for tag")); | 1954 | build_string ("No catch for tag")); |
| 1948 | 1955 | ||
| 1949 | Fput (Qend_of_file, Qerror_conditions, | 1956 | Fput (Qend_of_file, Qerror_conditions, |
| 1950 | Fcons (Qend_of_file, Fcons (Qerror, Qnil))); | 1957 | Fcons (Qend_of_file, error_tail)); |
| 1951 | Fput (Qend_of_file, Qerror_message, | 1958 | Fput (Qend_of_file, Qerror_message, |
| 1952 | build_string ("End of file during parsing")); | 1959 | build_string ("End of file during parsing")); |
| 1953 | 1960 | ||
| 1961 | arith_tail = Fcons (Qarith_error, error_tail); | ||
| 1954 | Fput (Qarith_error, Qerror_conditions, | 1962 | Fput (Qarith_error, Qerror_conditions, |
| 1955 | Fcons (Qarith_error, Fcons (Qerror, Qnil))); | 1963 | arith_tail); |
| 1956 | Fput (Qarith_error, Qerror_message, | 1964 | Fput (Qarith_error, Qerror_message, |
| 1957 | build_string ("Arithmetic error")); | 1965 | build_string ("Arithmetic error")); |
| 1958 | 1966 | ||
| 1959 | Fput (Qbeginning_of_buffer, Qerror_conditions, | 1967 | Fput (Qbeginning_of_buffer, Qerror_conditions, |
| 1960 | Fcons (Qbeginning_of_buffer, Fcons (Qerror, Qnil))); | 1968 | Fcons (Qbeginning_of_buffer, error_tail)); |
| 1961 | Fput (Qbeginning_of_buffer, Qerror_message, | 1969 | Fput (Qbeginning_of_buffer, Qerror_message, |
| 1962 | build_string ("Beginning of buffer")); | 1970 | build_string ("Beginning of buffer")); |
| 1963 | 1971 | ||
| 1964 | Fput (Qend_of_buffer, Qerror_conditions, | 1972 | Fput (Qend_of_buffer, Qerror_conditions, |
| 1965 | Fcons (Qend_of_buffer, Fcons (Qerror, Qnil))); | 1973 | Fcons (Qend_of_buffer, error_tail)); |
| 1966 | Fput (Qend_of_buffer, Qerror_message, | 1974 | Fput (Qend_of_buffer, Qerror_message, |
| 1967 | build_string ("End of buffer")); | 1975 | build_string ("End of buffer")); |
| 1968 | 1976 | ||
| 1969 | Fput (Qbuffer_read_only, Qerror_conditions, | 1977 | Fput (Qbuffer_read_only, Qerror_conditions, |
| 1970 | Fcons (Qbuffer_read_only, Fcons (Qerror, Qnil))); | 1978 | Fcons (Qbuffer_read_only, error_tail)); |
| 1971 | Fput (Qbuffer_read_only, Qerror_message, | 1979 | Fput (Qbuffer_read_only, Qerror_message, |
| 1972 | build_string ("Buffer is read-only")); | 1980 | build_string ("Buffer is read-only")); |
| 1973 | 1981 | ||
| 1982 | #ifdef LISP_FLOAT_TYPE | ||
| 1983 | Qrange_error = intern ("range-error"); | ||
| 1984 | Qdomain_error = intern ("domain-error"); | ||
| 1985 | Qsingularity_error = intern ("singularity-error"); | ||
| 1986 | Qoverflow_error = intern ("overflow-error"); | ||
| 1987 | Qunderflow_error = intern ("underflow-error"); | ||
| 1988 | |||
| 1989 | Fput (Qdomain_error, Qerror_conditions, | ||
| 1990 | Fcons (Qdomain_error, arith_tail)); | ||
| 1991 | Fput (Qdomain_error, Qerror_message, | ||
| 1992 | build_string ("Arithmetic domain error")); | ||
| 1993 | |||
| 1994 | Fput (Qrange_error, Qerror_conditions, | ||
| 1995 | Fcons (Qrange_error, arith_tail)); | ||
| 1996 | Fput (Qrange_error, Qerror_message, | ||
| 1997 | build_string ("Arithmetic range error")); | ||
| 1998 | |||
| 1999 | Fput (Qsingularity_error, Qerror_conditions, | ||
| 2000 | Fcons (Qsingularity_error, Fcons (Qdomain_error, arith_tail))); | ||
| 2001 | Fput (Qsingularity_error, Qerror_message, | ||
| 2002 | build_string ("Arithmetic singularity error")); | ||
| 2003 | |||
| 2004 | Fput (Qoverflow_error, Qerror_conditions, | ||
| 2005 | Fcons (Qoverflow_error, Fcons (Qdomain_error, arith_tail))); | ||
| 2006 | Fput (Qoverflow_error, Qerror_message, | ||
| 2007 | build_string ("Arithmetic overflow error")); | ||
| 2008 | |||
| 2009 | Fput (Qunderflow_error, Qerror_conditions, | ||
| 2010 | Fcons (Qunderflow_error, Fcons (Qdomain_error, arith_tail))); | ||
| 2011 | Fput (Qunderflow_error, Qerror_message, | ||
| 2012 | build_string ("Arithmetic underflow error")); | ||
| 2013 | |||
| 2014 | staticpro (&Qrange_error); | ||
| 2015 | staticpro (&Qdomain_error); | ||
| 2016 | staticpro (&Qsingularity_error); | ||
| 2017 | staticpro (&Qoverflow_error); | ||
| 2018 | staticpro (&Qunderflow_error); | ||
| 2019 | #endif /* LISP_FLOAT_TYPE */ | ||
| 2020 | |||
| 1974 | staticpro (&Qnil); | 2021 | staticpro (&Qnil); |
| 1975 | staticpro (&Qt); | 2022 | staticpro (&Qt); |
| 1976 | staticpro (&Qquote); | 2023 | staticpro (&Qquote); |