|
STklos is the successor of STk
[6], a Scheme interpreter which was tightly
connected to the Tk graphical toolkit [11].
STk had an object layer which was called STklos. At this
time, STk was used to denote the base Scheme interpreter and
STklos was used to denote its object layer, which was an
extension. For instance, when programming a GUI application,
a user could access the widgets at the (low) Tk level, or access
them using a neat hierarchy of classes wrapped in STklos. Since the object layer is now more closely integrated with
the language, the new system has been renamed STklos and
STk is now used to designate the old system. Compatibility with STk: STklos has been
completely rewritten and as a consequence, due to new
implementation choices, old STk programs are not fully
compatible with the new system. However, these changes are very
minor and adapting a STk program for the STklos system is
generally quite easy. The only programs which need heavier work
are programs which use Tk without objects, since the new
preferred GUI system is now based on GTK+
[2]. Programmers used to GUI programming using
STklos classes will find that both system, even if not
identical in every points, share the same philosophy.
1.2.1 Identifiers
In STklos, identifiers which start (or end) with a colon
": " are considered as keywords. For instance
:foo and bar: are STklos keywords, but
not:key is not a keyword. See
section Keywords for more information
There are four types of comments in STklos: - a semicolon "
; " indicates the start of a
comment. This kind of comment extends to the end of the line (as
described in R5RS).
- multi-lines comment use the classical Lisp convention:
a comment begins with "
#| " and ends with "|# ".
This form of comment is now defined by SRFI-30
(Nested Multi-line Comments).
- a sharp sign followed by a semicolon "
#; "
comments the next Scheme expression. This is useful to comment
a piece of code which spans multiple lines
- comments can also be introduced by "
#! "''.
Such a comment extends to the end of the line which introduces
it. This extension is particularly useful for building STklos
scripts. On most Unix implementations, if the first line of a
script looks like this:
#!/usr/local/bin/stklos -file
then the script can be started directly as if it was a binary
program. STklos is loaded behind the scene and
executes the script as a Scheme program. This form is compatible with
the notation introduced in SRFI-22
(Running Scheme Scripts on Unix)Note that, as a special case, that the sequences
"#!key ", "#!optional " and
"#!rest " are respectively converted to the STklos
keywords ":key ", ":optional " and
":rest ". This permits to Scheme lambdas, which
accepts keywords and optional arguments, to be compatible with
DSSSL lambdas [10].
1.2.3 Other Notations
STk accepts all the notations defined in R5RS plus
See the original R5RS document for more informations on
the basic concepts of the Scheme Programming Language. |