STk(1) January_1998 STk(1) _________________________________________________________________ NNAAMMEE stk, snow - A Scheme interpreter using the Tk toolkit SSYYNNOOPPSSIISS ssttkk [_o_p_t_i_o_n_s] [_a_r_g _a_r_g _._._.] ssnnooww [_o_p_t_i_o_n_s] [_a_r_g _a_r_g _._._.] OOPPTTIIOONNSS ssttkk interpreter accepts several command-line options which may be abbreviated, as long as the abbreviation is unam­ biguous (e.g. --hh, --hhee, --hheell are three possibe abbrevia­ tions for the --hheellpp option). --ccoolloorrmmaapp nneeww Specifies that the window should have a new private colormap instead of using the default colormap for the screen. --ddiissppllaayy _d_i_s_p_l_a_y Display (and screen) on which to display window. --ffiillee _f_i_l_e_N_a_m_e Read commands from _f_i_l_e_N_a_m_e rather than standard input. The last element in _f_i_l_e_­ _N_a_m_e will be used as the title for the application and name of its interpreter for sseenndd commands (unless overridden by the --nnaammee option). --ggeeoommeettrryy _g_e_o_m_e_t_r_y Initial geometry to use for window. --nnaammee _n_a_m_e Use _n_a_m_e as the title to be displayed in the window, and as the name of the inter­ preter for sseenndd commands. --ssyynncc Execute all X server commands syn­ chronously, so that errors are reported immediately. This will result in much slower execution, but it is useful for debugging. --vviissuuaall _v_i_s_u_a_l Specifies the visual to use for the win­ dow._V_i_s_u_a_l may be one of the following: _b_e_s_t, _d_i_r_e_c_t_c_o_l_o_r, _g_r_a_y_s_c_a_l_e, _g_r_e_y_s_c_a_l_e, _p_s_e_u_d_o_c_o_l_o_r, _s_t_a_t_i_c_c_o_l_o_r, _s_t_a_t_i_c_g_r_a_y, _s_t_a_t_­ _i_c_g_r_e_y, _t_r_u_e_c_o_l_o_r, or _d_e_f_a_u_l_t --nnoo--ttkk Don't initialize the Tk toolkit --llooaadd _f_i_l_e_N_a_m_e Evaluate expressions contained in _f_i_l_e_N_a_m_e before reading expressions from standard STk 4.0 1 STk(1) January_1998 STk(1) input. --iimmaaggee _f_i_l_e_N_a_m_e Restore the state saved in _f_i_l_e_N_a_m_e by the _d_u_m_p primitive (Note: For now, _d_u_m_p works only on SunOS 4.1.x, Linux 1.x (a.out for­ mat) and FreeBSD). --cceellllss _n_u_m_b_e_r Set the default size for the heap to _n_u_m_b_e_r cells. The given number is also the amount of cells used when extending the heap. Default value is 20000. --iinntteerraaccttiivvee Tell the interpreter that it is used inter­ actively (even if it doesn't think so). --hheellpp Print the version of the system and abort execution. --hheellpp Print a summary of the command-line options and exit. ---- Pass all remaining arguments through to the script's aarrggvv variable without interpreting them. This provides a mechanism for pass­ ing arguments such as --nnaammee to a script instead of having wwiisshh interpret them. _________________________________________________________________ DDEESSCCRRIIPPTTIIOONN SSttkk is a Scheme R4RS interpreter which provide a simple access to the X11 Tk toolkit. If the --nnoo--ttkk option is pro­ vided to the interpreter, the Tk library is not initial­ ized and no main window is created. If ssttkk is invoked with no --ff option then it reads Scheme expressions inter­ actively from standard input. It will continue processing commands until all windows have been deleted or until end- of-file is reached on standard input. SSnnooww is a _l_i_g_h_t version of the ssttkk interpreter which does not provide support for the Tk toolkit. This interpreter does not recognize the options --ddiissppllaayy, --ggeeoommeettrryy, --ssyynncc --ccoolloorrmmaapp, --vviissuuaall and --nnoo--ttkk which are meaningless with­ out Tk. This interpreter is called, rather than the stan­ dard one, when the shell DISPLAY variable is not initial­ ized. If the --ffiillee option is provided to Tk, then ssttkk reads Scheme forms from the file named in the --ffiillee option. These forms will normally create an interactive interface consisting of one or more widgets. When the end of the STk 4.0 2 STk(1) January_1998 STk(1) command file is reached, ssttkk will continue to respond to X events until all windows have been deleted. NNoottee:: The --ffiillee exits for compatibility reasons and can be eventually ommited. In there is no --ffiillee option used, the first argument in the command line is taken as the name of the script file to execute. To launch an interactive script with an argument, you have to use the ---- option. The --iinntteerraaccttiivvee option forces the interpreter in interac­ tive mode. In this mode, standard output and standard error are unbuffered. Use this option when you launch ssttkk from eemmaaccss. VVAARRIIAABBLLEESS Following Scheme variables are set when SSttkk starts: **aarrggcc** Contains a count of the number of _a_r_g argu­ ments (0 if none), not including the options described above. **aarrggvv** Contains a Scheme list whose elements are the _a_r_g arguments (not including the options described above), in order, or an empty list if there are no _a_r_g arguments. **pprrooggrraamm--nnaammee** Contains _f_i_l_e_N_a_m_e if it was provided (in a --ffiillee option or as first argument of the command line). Otherwise, contains the name by which the interpreter was invoked. SSCCRRIIPPTT FFIILLEESS If you create a STk script in a file whose first line is ##!!//uussrr//llooccaall//bbiinn//ssttkk --ff then you can invoke the script file directly from your shell if you mark it as executable. This assumes that ssttkk has been installed in the default location in /usr/local/bin; if it's installed somewhere else then you'll have to modify the above line to match. Note that --ff which was necessary with pre-4.0 versions of SSTTkk is no more necessary and can be omitted. EENNVVIIRROONNMMEENNTT VVAARRIIAABBLLEESS ssttkk uses the following shell variables: _S_T_K___L_I_B_R_A_R_Y This variable indicates where the library files are located. This variable allows to STk 4.0 3 STk(1) January_1998 STk(1) overload the default value of the Scheme variable _*_s_t_k_-_l_i_b_r_a_r_y_* which is automati­ cally calculated by the interpreter.(i.e. _s_t_k or _s_n_o_w). _S_T_K___L_O_A_D___P_A_T_H This variable serves to initialize the _*_l_o_a_d_-_p_a_t_h_* Scheme variable. This variable is a list of paths to try when in a load command. _S_T_K___H_E_L_P___P_A_T_H This variable serves to initialize the _*_h_e_l_p_-_p_a_t_h_* Scheme variable. It must con­ tain a list of documentation directories. This variable is used by the help proce­ dure. _S_T_K___I_M_A_G_E___P_A_T_H This variable serves to initialize the _*_i_m_a_g_e_-_p_a_t_h_* Scheme variable. It must con­ tain a list of images directories. This variable is used by the make-image proce­ dure. FFIILLEESS _._/_i_n_i_t_._s_t_k _$_S_T_K___L_I_B_R_A_R_Y_/_S_T_k_/_i_n_i_t_._s_t_k When ssttkk starts running, it tries to load the file _i_n_i_t_._s_t_k in the current directory. If this file is not present, it tries to load this file in the SSTTkk__LLIIBBRRAARRYY directory (the value of SSTTkk__LLIIBBRRAARRYY is automatically computed to be in a sibling directory of the interpreter executable. _~_/_._s_t_k_r_c Standard _i_n_i_t_._s_t_k file tries to load the file _~_/_._s_t_k_r_c. This file can be used to store functions definitions or variables settings that you want to be executed at each interpreter invocation. SSEEEE AALLSSOO wish(1) STk 4.0 4