The FRANZ LISP Manual by _J_o_h_n _K_. _F_o_d_e_r_a_r_o _K_e_i_t_h _L_. _S_k_l_o_w_e_r April 1982 A document in four movements 9 9 _O_v_e_r_t_u_r_e _A _c_h_o_r_u_s _o_f _s_t_u_d_e_n_t_s _u_n_d_e_r _t_h_e _d_i_r_e_c_t_i_o_n _o_f _R_i_c_h_a_r_d _F_a_t_e_m_a_n _h_a_v_e _c_o_n_t_r_i_b_u_t_e_d _t_o _b_u_i_l_d_i_n_g _F_R_A_N_Z _L_I_S_P _f_r_o_m _a _m_e_r_e _m_e_l_o_d_y _i_n_t_o _a _f_u_l_l _s_y_m_p_h_o_n_y . _T_h_e _m_a_j_o_r _c_o_n_t_r_i_b_u_t_o_r_s _t_o _t_h_e _i_n_i_t_i_a_l _s_y_s_t_e_m _w_e_r_e _M_i_k_e _C_u_r_r_y, _J_o_h_n _B_r_e_e_d_l_o_v_e _a_n_d _J_e_f_f _L_e_v_i_n_s_k_y. _B_i_l_l _R_o_w_a_n _a_d_d_e_d _t_h_e _g_a_r_b_a_g_e _c_o_l_l_e_c_t_o_r _a_n_d _a_r_r_a_y _p_a_c_k_a_g_e. _T_o_m _L_o_n_d_o_n _w_o_r_k_e_d _o_n _a_n _e_a_r_l_y _c_o_m_p_i_l_e_r _a_n_d _h_e_l_p_e_d _i_n _o_v_e_r_a_l_l _s_y_s_t_e_m _d_e_s_i_g_n. _K_e_i_t_h _S_k_l_o_w_e_r _h_a_s _c_o_n_t_r_i_b_u_t_e_d _m_u_c_h _t_o _F_R_A_N_Z _L_I_S_P, _a_d_d_i_n_g _t_h_e _b_i_g_n_u_m _p_a_c_k_a_g_e _a_n_d _r_e_w_r_i_t_i_n_g _m_o_s_t _o_f _t_h_e _c_o_d_e _t_o _i_n_c_r_e_a_s_e _i_t_s _e_f_f_i_c_i_e_n_c_y _a_n_d _c_l_a_r_i_t_y. _K_i_p_p _H_i_c_k_m_a_n _a_n_d _C_h_a_r_l_e_s _K_o_e_s_t_e_r _a_d_d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_u_r_e_s, _b_u_g _f_i_x_e_s, _o_r _u_s_e_f_u_l _p_r_o_g_r_a_m _p_a_c_k_a_g_e_s, _a_n_d _w_e _w_i_l_l _a_t_t_e_m_p_t _t_o _r_e_d_i_s_t_r_i_b_u_t_e _s_u_c_h _c_o_n_t_r_i_b_u_t_i_o_n_s. 8c9 1980, 1981 by the Regents of the University of California. (exceptions: Chapters 13, 14 (first half), 15 and 16 have separate copyrights, as indicated. These are reproduced by per- mission of the copyright holders.) Permission to copy without fee all or part of this material is granted provided that the copies are not made or distributed for direct commercial advantage, and the copyright notice of the Regents, University of California, is given. All rights reserved. 9 9 Work reported herein was supported in part by the U. S. Depart- ment of Energy, Contract DE-AT03-76SF00034, Project Agreement DE-AS03-79ER10358, and the National Science Foundation under Grant No. MCS 7807291 UNIX is a trademark of Bell Laboratories. 9 9 Score First Movement (_a_l_l_e_g_r_o _n_o_n _t_r_o_p_p_o) 1. FRANZ LISP _I_n_t_r_o_d_u_c_t_i_o_n _t_o _F_R_A_N_Z _L_I_S_P, _d_e_t_a_i_l_s _o_f _d_a_t_a _t_y_p_e_s, _a_n_d _d_e_s_c_r_i_p_t_i_o_n _o_f _n_o_t_a_t_i_o_n 2. Data Structure Access _F_u_n_c_t_i_o_n_s _f_o_r _t_h_e _c_r_e_a_t_i_o_n, _d_e_s_t_r_u_c_t_i_o_n _a_n_d _m_a_n_i_p_u_l_a_- _t_i_o_n _o_f _l_i_s_p _d_a_t_a _o_b_j_e_c_t_s. 3. Arithmetic Functions _F_u_n_c_t_i_o_n_s _t_o _p_e_r_f_o_r_m _a_r_i_t_h_m_e_t_i_c _o_p_e_r_a_t_i_o_n_s. 4. Special Functions _F_u_n_c_t_i_o_n_s _f_o_r _a_l_t_e_r_i_n_g _f_l_o_w _o_f _c_o_n_t_r_o_l. _F_u_n_c_t_i_o_n_s _f_o_r _m_a_p_p_i_n_g _o_t_h_e_r _f_u_n_c_t_i_o_n_s _o_v_e_r _l_i_s_t_s. 5. I/O Functions _F_u_n_c_t_i_o_n_s _f_o_r _r_e_a_d_i_n_g _a_n_d _w_r_i_t_i_n_g _f_r_o_m _p_o_r_t_s. _F_u_n_c_- _t_i_o_n_s _f_o_r _t_h_e _m_o_d_i_f_i_c_a_t_i_o_n _o_f _t_h_e _r_e_a_d_e_r'_s _s_y_n_t_a_x. 6. System Functions _F_u_n_c_t_i_o_n_s _f_o_r _s_t_o_r_a_g_e _m_a_n_a_g_e_m_e_n_t, _d_e_b_u_g_g_i_n_g, _a_n_d _f_o_r _t_h_e _r_e_a_d_i_n_g _a_n_d _s_e_t_t_i_n_g _o_f _g_l_o_b_a_l _L_i_s_p _s_t_a_t_u_s _v_a_r_i_- _a_b_l_e_s. _F_u_n_c_t_i_o_n_s _f_o_r _d_o_i_n_g _U_N_I_X-_s_p_e_c_i_f_i_c _t_a_s_k_s _s_u_c_h _a_s _p_r_o_c_e_s_s _c_o_n_t_r_o_l. Second Movement (_L_a_r_g_o) 7. The Reader _A _d_e_s_c_r_i_p_t_i_o_n _o_f _t_h_e _s_y_n_t_a_x _c_o_d_e_s _u_s_e_d _b_y _t_h_e _r_e_a_d_e_r. _A_n _e_x_p_l_a_n_a_t_i_o_n _o_f _c_h_a_r_a_c_t_e_r _m_a_c_r_o_s. 8. Functions and Macros _A _d_e_s_c_r_i_p_t_i_o_n _o_f _t_h_e _v_a_r_i_o_u_s _t_y_p_e_s _o_f _f_u_n_c_t_i_o_n_s _a_n_d _m_a_c_r_o_s. _A_n _e_x_a_m_p_l_e _o_f _t_h_e _u_s_e _o_f _f_o_r_e_i_g_n _f_u_n_c_t_i_o_n_s. 9. Arrays _A _d_e_t_a_i_l_e_d _d_e_s_c_r_i_p_t_i_o_n _o_f _t_h_e _p_a_r_t_s _o_f _a_n _a_r_r_a_y _a_n_d _o_f _M_a_c_l_i_s_p _c_o_m_p_a_t_i_b_l_e _a_r_r_a_y_s. 10. Exception Handling _A _d_e_s_c_r_i_p_t_i_o_n _o_f _t_h_e _e_r_r_o_r _h_a_n_d_l_i_n_g _s_e_q_u_e_n_c_e _a_n_d _o_f _a_u_t_o_l_o_a_d_i_n_g. 9 9 Third Movement (_S_c_h_e_r_z_o) 11. The Joseph Lister Trace Package _A _d_e_s_c_r_i_p_t_i_o_n _o_f _a _v_e_r_y _u_s_e_f_u_l _d_e_b_u_g_g_i_n_g _a_i_d. 12. Liszt, the lisp compiler _A _d_e_s_c_r_i_p_t_i_o_n _o_f _t_h_e _o_p_e_r_a_t_i_o_n _o_f _t_h_e _c_o_m_p_i_l_e_r _a_n_d _h_i_n_t_s _f_o_r _m_a_k_i_n_g _f_u_n_c_t_i_o_n_s _c_o_m_p_i_l_a_b_l_e. 13. CMU Top Level and file package _A _d_e_s_c_r_i_p_t_i_o_n _o_f _a _t_o_p _l_e_v_e_l _w_i_t_h _a _h_i_s_t_o_r_y _m_e_c_h_a_n_i_s_m _a_n_d _a _p_a_c_k_a_g_e _w_h_i_c_h _h_e_l_p_s _y_o_u _k_e_e_p _t_r_a_c_k _o_f _f_i_l_e_s _o_f _l_i_s_p _f_u_n_c_t_i_o_n_s. 14 Stepper _A _d_e_s_c_r_i_p_t_i_o_n _o_f _a _p_r_o_g_r_a_m _w_h_i_c_h _p_e_r_m_i_t_s _y_o_u _t_o _p_u_t _b_r_e_a_k_p_o_i_n_t_s _i_n _l_i_s_p _c_o_d_e _a_n_d _t_o _s_i_n_g_l_e _s_t_e_p _i_t. _A _d_e_s_c_r_i_p_t_i_o_n _o_f _t_h_e _e_v_a_l_h_o_o_k _a_n_d _f_u_n_c_a_l_l_h_o_o_k _m_e_c_h_a_n_i_s_m. 15 Fixit _A _p_r_o_g_r_a_m _w_h_i_c_h _p_e_r_m_i_t_s _y_o_u _t_o _e_x_a_m_i_n_e _a_n_d _m_o_d_i_f_y _e_v_a_l_u_a_t_i_o_n _s_t_a_c_k _i_n _o_r_d_e_r _t_o _f_i_x _b_u_g_s _o_n _t_h_e _f_l_y. 16 Lisp Editor _A _s_t_r_u_c_t_u_r_e _e_d_i_t_o_r _f_o_r _i_n_t_e_r_a_c_t_i_v_e _m_o_d_i_f_i_c_a_t_i_o_n _o_f _l_i_s_p _c_o_d_e. Final Movement (_a_l_l_e_g_r_o) Appendix A - Function Index Appendix B - List of Special Symbols Appendix C - Short Subjects _G_a_r_b_a_g_e _c_o_l_l_e_c_t_o_r, _D_e_b_u_g_g_i_n_g, _D_e_f_a_u_l_t _T_o_p _L_e_v_e_l 9 9