commit 048e816f0c685e6b22656c50fa4e53bad025ed08
parent 70396a6c49be6829b8fb6c3815bcb06dd17b2874
Author: Yuval Langer <yuval.langer@gmail.com>
Date: Sat, 15 Jun 2024 01:30:30 +0300
Some stylistic changes.
1. Use triple comments for full line comments, such as the copyright
and license.
2. Merge use-modules into the define-module.
Diffstat:
M | pstk.scm | | | 209 | +++++++++++++++++++++++++++++++++++++++---------------------------------------- |
1 file changed, 104 insertions(+), 105 deletions(-)
diff --git a/pstk.scm b/pstk.scm
@@ -1,105 +1,105 @@
-; PS/Tk -- A Portable Scheme Interface to the Tk GUI Toolkit
-; Copyright (C) 2021-2022 Daniil Archangelsky aka Kiky Tokamuro
-; Copyright (C) 2008 Kenneth A Dickey
-; Copyright (C) 2006-2008 Nils M Holm
-; Copyright (C) 2004 Wolf-Dieter Busch
-; All rights reserved.
-;
-; Redistribution and use in source and binary forms, with or without
-; modification, are permitted provided that the following conditions
-; are met:
-; 1. Redistributions of source code must retain the above copyright
-; notice, this list of conditions and the following disclaimer.
-; 2. Redistributions in binary form must reproduce the above copyright
-; notice, this list of conditions and the following disclaimer in the
-; documentation and/or other materials provided with the distribution.
-;
-; THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
-; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
-; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
-; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
-; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
-; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
-; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
-; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
-; SUCH DAMAGE.
-;
-; PS/Tk is based on Chicken/Tk by Wolf-Dieter Busch (2004):
-; http://wolf-dieter-busch.de/html/Software/Tools/ChickenTk.htm
-; which is in turn based on Scheme_wish by Sven Hartrumpf (1997, 1998):
-; http://pi7.fernuni-hagen.de/hartrumpf/scheme_wish.scm
-;
-; These are the changes that I (Nils) made to turn Chicken/Tk into PS/Tk:
-;
-; - Removed all Chicken-isms except for PROCESS.
-; - All PS/Tk function names begin with TK/ or TK-:
-; EVAL-WISH --> TK-EVAL-WISH
-; GET-TK-VAR --> TK-GET-VAR
-; SET-TK-VAR! --> TK-SET-VAR!
-; START-TK --> TK-START
-; END-TK --> TK-END
-; EVENT-LOOP --> TK-EVENT-LOOP
-; - Added TK-DISPATCH-EVENT.
-; - Added TK-WAIT-FOR-WINDOW because TK/WAIT returned too early.
-; - Removed some unused functions and variables.
-; - Replaced keyword lists with property lists.
-; - Removed ScrolledText compound widget.
-; - Removed :WIDGET-NAME option.
-; - Added a PLT Scheme version of RUN-PROGRAM.
-;
-; Contributions (in order of appearance):
-; - Jens Axel Soegaard: PLT Scheme/Windows RUN-PROGRAM.
-; - Taylor R Campbell: Scheme48 RUN-PROGRAM, portable GENSYM, and some R5RS
-; portability fixes.
-; - Jeffrey T. Read: Gambit hacks (RUN-PROGRAM, keyword hack).
-; - Marc Feeley: Various versions of RUN-PROGRAM (Bigloo, Gauche, Guile,
-; Kawa, Scsh, Stklos), SRFI-88 keyword auto-detection, some bug fixes.
-; - David St-Hilaire: suggested catching unspecific value in form->string.
-; - Ken Dickey: added Ikarus Scheme
-; - Ken Dickey: added Larceny Scheme
-; Thank you!
-;
-; Change Log:
-; 2022-03-07 Added tk-throw for turn Tk error to Scheme errors
-; Added application termination in case of error in pipe to scheme process
-; 2022-03-05 Rewrited on Guile module
-; Changed "_IONBF" to 'none
-; 2021-12-01 Deleted all non Guile sections.
-; Changed "set-batch-mode?!" to "ensure-batch-mode!".
-; Deleted the "bottom" function call.
-; 2008-06-22 Added Larceny Scheme support.
-; 2008-02-29 Added R6RS (Ikarus Scheme) support, added TTK/STYLE.
-; 2007-06-27 Renamed source file to pstk.scm.
-; 2007-06-27 Re-factored some large procedures, applied some cosmetics.
-; 2007-06-26 FORM->STRING catches unspecific values now, so event handlers
-; no longer have to return specific values.
-; 2007-06-26 Re-imported the following ports from the processio/v1 snowball:
-; Bigloo, Gauche, Guile, Kawa, Scsh, Stklos.
-; 2007-06-26 Added auto-detection of SRFI-88 keywords.
-; 2007-03-03 Removed callback mutex, because it blocked some redraw
-; operations. Use TK-WITH-LOCK to protect critical sections.
-; 2007-02-03 Added Tile support: TTK-MAP-WIDGETS, TTK/AVAILABLE-THEMES,
-; TTK/SET-THEME.
-; 2007-01-20 Added (Petite) Chez Scheme port.
-; 2007-01-06 Fix: TK-WAIT-FOR-WINDOW requires nested callbacks.
-; 2007-01-05 Added code to patch through fatal TCL messages.
-; 2007-01-05 Protected call-backs by a mutex, so accidental double
-; clicks, etc cannot mess up program state.
-; 2006-12-21 Made FORM->STRING accept '().
-; 2006-12-18 Installing WM_DELETE_WINDOW handler in TK-START now, so it does
-; not get reset in TK-EVENT-LOOP.
-; 2006-12-18 Made TK-START and TK-END return () instead of #<unspecific>
-; (which crashes FORM->STRING).
-; 2006-12-12 Fixed some wrong Tcl quotation (introduced by myself).
-; 2006-12-09 Added TK/BELL procedure.
-; 2006-12-08 Replaced ATOM->STRING by FORM->STRING.
-; 2006-12-06 Added TK-WAIT-UNTIL-VISIBLE.
-; 2006-12-03 Made more variables local to outer LETREC.
-; 2006-12-03 Added Gambit port and keywords hack.
-; 2006-12-02 Added Scheme 48 port, portable GENSYM, R5RS fixes.
-; 2006-12-02 Added PLT/Windows port.
+;;; PS/Tk -- A Portable Scheme Interface to the Tk GUI Toolkit
+;;; Copyright (C) 2021-2022 Daniil Archangelsky aka Kiky Tokamuro
+;;; Copyright (C) 2008 Kenneth A Dickey
+;;; Copyright (C) 2006-2008 Nils M Holm
+;;; Copyright (C) 2004 Wolf-Dieter Busch
+;;; All rights reserved.
+;;;
+;;; Redistribution and use in source and binary forms, with or without
+;;; modification, are permitted provided that the following conditions
+;;; are met:
+;;; 1. Redistributions of source code must retain the above copyright
+;;; notice, this list of conditions and the following disclaimer.
+;;; 2. Redistributions in binary form must reproduce the above copyright
+;;; notice, this list of conditions and the following disclaimer in the
+;;; documentation and/or other materials provided with the distribution.
+;;;
+;;; THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
+;;; ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+;;; IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+;;; ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
+;;; FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+;;; DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+;;; OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+;;; HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+;;; LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+;;; OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+;;; SUCH DAMAGE.
+;;;
+;;; PS/Tk is based on Chicken/Tk by Wolf-Dieter Busch (2004):
+;;; http://wolf-dieter-busch.de/html/Software/Tools/ChickenTk.htm
+;;; which is in turn based on Scheme_wish by Sven Hartrumpf (1997, 1998):
+;;; http://pi7.fernuni-hagen.de/hartrumpf/scheme_wish.scm
+;;;
+;;; These are the changes that I (Nils) made to turn Chicken/Tk into PS/Tk:
+;;;
+;;; - Removed all Chicken-isms except for PROCESS.
+;;; - All PS/Tk function names begin with TK/ or TK-:
+;;; EVAL-WISH --> TK-EVAL-WISH
+;;; GET-TK-VAR --> TK-GET-VAR
+;;; SET-TK-VAR! --> TK-SET-VAR!
+;;; START-TK --> TK-START
+;;; END-TK --> TK-END
+;;; EVENT-LOOP --> TK-EVENT-LOOP
+;;; - Added TK-DISPATCH-EVENT.
+;;; - Added TK-WAIT-FOR-WINDOW because TK/WAIT returned too early.
+;;; - Removed some unused functions and variables.
+;;; - Replaced keyword lists with property lists.
+;;; - Removed ScrolledText compound widget.
+;;; - Removed :WIDGET-NAME option.
+;;; - Added a PLT Scheme version of RUN-PROGRAM.
+;;;
+;;; Contributions (in order of appearance):
+;;; - Jens Axel Soegaard: PLT Scheme/Windows RUN-PROGRAM.
+;;; - Taylor R Campbell: Scheme48 RUN-PROGRAM, portable GENSYM, and some R5RS
+;;; portability fixes.
+;;; - Jeffrey T. Read: Gambit hacks (RUN-PROGRAM, keyword hack).
+;;; - Marc Feeley: Various versions of RUN-PROGRAM (Bigloo, Gauche, Guile,
+;;; Kawa, Scsh, Stklos), SRFI-88 keyword auto-detection, some bug fixes.
+;;; - David St-Hilaire: suggested catching unspecific value in form->string.
+;;; - Ken Dickey: added Ikarus Scheme
+;;; - Ken Dickey: added Larceny Scheme
+;;; Thank you!
+;;;
+;;; Change Log:
+;;; 2022-03-07 Added tk-throw for turn Tk error to Scheme errors
+;;; Added application termination in case of error in pipe to scheme process
+;;; 2022-03-05 Rewrited on Guile module
+;;; Changed "_IONBF" to 'none
+;;; 2021-12-01 Deleted all non Guile sections.
+;;; Changed "set-batch-mode?!" to "ensure-batch-mode!".
+;;; Deleted the "bottom" function call.
+;;; 2008-06-22 Added Larceny Scheme support.
+;;; 2008-02-29 Added R6RS (Ikarus Scheme) support, added TTK/STYLE.
+;;; 2007-06-27 Renamed source file to pstk.scm.
+;;; 2007-06-27 Re-factored some large procedures, applied some cosmetics.
+;;; 2007-06-26 FORM->STRING catches unspecific values now, so event handlers
+;;; no longer have to return specific values.
+;;; 2007-06-26 Re-imported the following ports from the processio/v1 snowball:
+;;; Bigloo, Gauche, Guile, Kawa, Scsh, Stklos.
+;;; 2007-06-26 Added auto-detection of SRFI-88 keywords.
+;;; 2007-03-03 Removed callback mutex, because it blocked some redraw
+;;; operations. Use TK-WITH-LOCK to protect critical sections.
+;;; 2007-02-03 Added Tile support: TTK-MAP-WIDGETS, TTK/AVAILABLE-THEMES,
+;;; TTK/SET-THEME.
+;;; 2007-01-20 Added (Petite) Chez Scheme port.
+;;; 2007-01-06 Fix: TK-WAIT-FOR-WINDOW requires nested callbacks.
+;;; 2007-01-05 Added code to patch through fatal TCL messages.
+;;; 2007-01-05 Protected call-backs by a mutex, so accidental double
+;;; clicks, etc cannot mess up program state.
+;;; 2006-12-21 Made FORM->STRING accept '().
+;;; 2006-12-18 Installing WM_DELETE_WINDOW handler in TK-START now, so it does
+;;; not get reset in TK-EVENT-LOOP.
+;;; 2006-12-18 Made TK-START and TK-END return () instead of #<unspecific>
+;;; (which crashes FORM->STRING).
+;;; 2006-12-12 Fixed some wrong Tcl quotation (introduced by myself).
+;;; 2006-12-09 Added TK/BELL procedure.
+;;; 2006-12-08 Replaced ATOM->STRING by FORM->STRING.
+;;; 2006-12-06 Added TK-WAIT-UNTIL-VISIBLE.
+;;; 2006-12-03 Made more variables local to outer LETREC.
+;;; 2006-12-03 Added Gambit port and keywords hack.
+;;; 2006-12-02 Added Scheme 48 port, portable GENSYM, R5RS fixes.
+;;; 2006-12-02 Added PLT/Windows port.
(define-module (pstk)
#:export (*wish-program*
@@ -159,9 +159,8 @@
ttk-map-widgets
ttk/available-themes
ttk/set-theme
- ttk/style))
-
-(use-modules (srfi srfi-88))
+ ttk/style)
+ #:use-modules ((srfi srfi-88)))
(define *wish-program* "tclsh")
(define *wish-debug-input* #f)