FAQ

From: <Marc.Furrer_at_di.epfl.ch>
Date: Mon, 03 Apr 95 15:37:39 +0200

html version available at http://ltiwww.epfl.ch/~furrer/STk/FAQ.html

;;; ****************************************************************
;;; Answers to Frequently Asked Questions about STk *************
;;; ****************************************************************
;;; Written by Marc Furrer
;;; with the extensive support from Erick Gallesio
;;; FAQ-STk
;;;
;;; $Date: 1995/03/06 14:33:21 $
;;; $Revision: 1.5 $




This is the STk FAQ.

If you think of questions that are appropriate for this FAQ, or would
like to improve an answer, please send e-mail to me at
Marc.Furrer_at_di.epfl.ch.

+++ Copyright +++

Copyright (c) 1995 by Marc Furrer and Erick Gallesio
All rights reserved.

This FAQ may be freely redistributed in its entirety without
modification provided that this copyright notice is not removed. It
may not be sold for profit or incorporated in commercial documents
(e.g., published for sale on CD-ROM, floppy disks, books, magazines,
or other print form) without the prior written permission of the
copyright holder. Permission is expressly granted for this document
to be made available for file transfer from installations offering
unrestricted anonymous file transfer on the Internet.

This article is provided AS IS without any express or implied
warranty.

+++ Introduction +++

STk is a scheme interpreter, with embedded support for the Tk graphical
package. It is as GUI friendly as Tk/Tcl, with the programming beauty of
Scheme ;-).

This file tries to answer most frequently asked question about
STk. It isn't a Scheme course nor a Tk course.

If you don't find an answer that should be here, please drop an e-mail
to Marc.Furrer_at_di.epfl.ch, with your question and, if possible, the
answer.


+++ Table of Contents +++


  [1.-] Generalities about STk
    [1.0] What is STk
    [1.1] Where do I get STk from
    [1.2] Where do I get the latest version of the FAQ
    [1.3] The STk Mailing List
    [1.4] Reporting a Bug
    [1.5] Getting more information about Scheme
    [1.6] Getting more information about Tk
  [2.-] What's making STk the Scheme interpreter you need
    [2.0] Differences with R4RS
    [2.1] Added Features
    [2.2] Contributed Packages
  [3.-] Why & How ? ... Trick and Treat with STk
    [3.0] Using STk from Emacs
    [3.1] Using the SLIB package with STk
    [3.2] Using lambda as call-backs
  [4.-] STklos,the STk object oriented extension to Scheme
    [4.0] STklos: Principle
    [4.1] STklos: Common traps


------------------------------

Subject : [1.0] What is STk


STk is a R4RS Scheme interpreter which can access to the Tk graphical package.
Conversely it can be seen as the John Ousterhout's Tk package where
the Tcl language has been replaced by Scheme.

STk also, provides an efficient object oriented system called STklos.
STklos is a full OO system with multi-inheritance, generic functions,
multi-methods and a true meta object protocol). STklos can be dynamically
loaded on systems which support this feature.

------------------------------

Subject : [1.1] Where do I get STk from


STk distribution is available on various sites. The original
distribution site is kaolin.unice.fr (193.48.229.225). Files are
available through anonymous ftp and are located in the /pub
directory. Distribution file names have the form STk-x.y.tar.gz, where
x and y represent the version and the release of the package. You can
also find interim releases of STk. Intermediate releases are stored in
file whose name have the form STk-x.y.z.tar.gz where z is the
intermediate release number.

------------------------------

Subject : [1.2] Where do I get the latest version of the FAQ


Latest version of the FAQ can be found at:

    + <http://ltiwww.epfl.ch/~furrer/STk/FAQ.html> for the html version
    + <http://ltiwww.epfl.ch/~furrer/STk/FAQ.txt> for the ASCII one.


Currently the FAQ is not archived elsewhere.

------------------------------

Subject : [1.3] The STk Mailing List


There is a mailing list for STk located on kaolin.unice.fr. The
intent of this mailing list is to permit to STk users to share
experiences, expose problems, submit ideas and everything which you
find interesting (and which is related to STk).

To subscribe to the mailing list, simply send a message with the word
subscribe in the Subject: field of you mail. Mail must be sent to the
following address: stk-request_at_kaolin.unice.fr

To unsubscribe from the mailing list, send a mail at previous e-mail
address with the word unsubscribe in the Subject: field.

For more information on the mailing list management send a message
with the word help in the Subject: field of your mail. In particular,
it is possible to find all the messages which have already been sent
on the STk mailing list.

Subscription/un-subscription/information requests are processed
automatically without human intervention. If you something goes wrong,
send a mail to eg_at_unice.fr.

Once you have properly subscribe to the mailing list,

        + you can send your messages about STk to stk_at_kaolin.unice.fr,
        + you will receive all the messages of the mailing list to the e-mail
          address you used when you subscribed to the list.

The mailing list is archived at:
         <http://kaolin.unice.fr:/pub/Mailing-list/Hypermail/index.html>

------------------------------

Subject : [1.4] Reporting a Bug


When you find a bug in STk, please send its description to the
following address stk-bugs_at_kaolin.unice.fr. Don't forget to indicate
the version you use and the architecture the system is compiled on.
Stk version and architecture can be found by using the version and
machine-type Scheme primitives. If possible, try to find a small
program which exhibit the bug.

------------------------------

Subject : [1.5] Getting more information about Scheme


+++ The R4RS document +++

R4RS is the document which fully describe the Scheme Programming
Language, it can be found in the Scheme repository in the directory:

        <ftp://ftp.cs.indiana.edu/pub/scheme-repository/doc>

Aubrey Jaffer has also translated this document in HTML. A version of this
document is available at

        <http://www-swiss.ai.mit.edu/~jaffer/r4rs_toc.html>


+++ The Scheme Repository +++

The main site where you can find (many) informations about Scheme is
located in the University of Indiana. The Scheme repository is
maintained by David Eby. The repository currently consists of the
following areas:

        + Lots of scheme code meant for benchmarking, library/support,
          research, education, and fun.
        + On-line documents: Machine readable standards documents, standards
          proposals, various Scheme-related tech reports, conference
          papers, mail
          archives, etc.
        + Most of the publicly available Scheme Implementations.
        + Material designed primarily for instruction.
        + Freely-distributable promotional or demonstration material for
          Scheme-related products.
        + Utilities (e.g., Schemeweb, SLaTeX).
        + Extraneous stuff, extensions, etc.

You can access the Scheme repository at:

        + <ftp://ftp.cs.indiana.edu/pub/scheme-repository>
        + <http://www.cs.indiana.edu/scheme-repository/SRhome.html>

The Scheme Repository is mirrored in Europe at:

        + <ftp://ftp.inria.fr/lang/Scheme>
        + <ftp://faui80.informatik.uni-erlangen.de/pub/scheme/yorku>
        + <ftp://ftp.informatik.uni-muenchen.de/pub/comp/programming/
          languages/scheme/scheme-repository>


+++ Usenet newsgroup and other addresses +++

There is a usenet newsgroup about the Scheme Programming language:

        comp.lang.scheme

Following addresses contains also material about the Scheme language

        + The Scheme FAQ
        <http://www.cs.cmu.edu:8001/Web/Groups/AI/html/faqs/lang/scheme/top.htm
l>
        
        + The Scheme Home Page at at MIT
        <http://www-swiss.ai.mit.edu/scheme-home.html>

        + The Scheme Underground web page
        <http://www.ai.mit.edu/projects/su/su.html>



------------------------------

Subject : [1.6] Getting more information about Tk


The reference about Tk is probably Ousterhout's book :

        "Tcl and the Tk Toolkit"

of course, you better not read the chapters about Tcl ;-)

------------------------------

Subject : [2.0] Differences with R4RS


+++ Symbols +++

STk symbol syntax has been augmented to allow case significant
symbols.

many global symbols have been added to the global environment, see
Appendix B of the STk Reference Manual.

+++ Types +++

STk implements all the types defined as mandatory in R4RS. However, complex
numbers and rational numbers (which are defined but not required in R4RS) are
not implemented. The lack of these types implies that some functions of
R4RS are not defined.

Some types which are not defined in R4RS are implemented in STk. Those
types are listed below:

        + input string port type
        + output string port type
        + keyword type
        + Tk command type
        + environment type
        + macro type
        + address type
        + hash table type
        + process type (launch and communication with subprocess)
        + socket type (TCP/UDP sockets)
        + regexp type (access to tcl regexp)

+++ Procedures +++

The following procedures are required by R4RS and are not implemented in the
STk interpreter.

        + char-ready?
        + transcript-off
        + transcript-on

Procedure char-ready? will be implemented in a future version.
Transcript-off and transcript-on can be simulated with various Unix
tools such as script or fep.

The following procedures are not implemented in the STk interpreter whereas
they are defined in R4RS (but not required). They are all
related to complex or rational numbers.

        + numerator
        + denominator
        + rationalize
        + make-rectangular
        + make-polar
        + real-part
        + magnitude
        + angle

This is more detailed in the Appendix B of the STk Reference Manual.


------------------------------

Subject : [2.1] Added Features


feature you will probably not find elsewhere.

        + dynamic loading of C module
        + ease of making C extension
        + ...


------------------------------

Subject : [2.2] Contributed Packages


among the package coming with STk we shall mention :

        + socket package
          allow access to the UNIX systems sockets

        + regexp package
          give access to the regular expression of Tk/Tcl
        
        + time package
          give access to the time function of an Unix box

you also have access to the SLIB package developed by Aubrey Jaffer.

------------------------------

Subject : [3.0] Using STk from Emacs


There are several ways to call stk from Emacs. One simple way consists to add
the following lines in your file $HOME/.emacs


(setq-default auto-mode-alist (append auto-mode-alist
                                      ("\\.stk$" . scheme-mode)
                                      ("\\.stklos$" . scheme-mode)))

;; Use cmu-scheme rather than xscheme (xscheme is wired with CScheme)
(autoload 'run-scheme "cmuscheme" "Run an inferior Scheme" t)
(setq scheme-program-name "stk")

(setq scheme-mode-hook
      '(lambda()
         (autoload 'run-scheme "cmuscheme" "Run an inferior Scheme" t)
         (setq scheme-program-name "stk")
         ;; Comment the two following lines if you don't want Font-locking
         (setq font-lock-keywords '(":[-a-zA-Z0-9]*"))
         (turn-on-font-lock))

(setq inferior-scheme-mode-hook '(lambda() (split-window)))



Another way consists to use a special purpose STk mode. You can find two
such modes in the /pub/Contrib directory of kaolin.unice.fr.


------------------------------

Subject : [3.1] Using the SLIB package with STk


Aubrey Jaffer maintains a package called SLIB which is a portable
Scheme library which provides compatibility and utility functions for
all standard scheme implementations. To use this package, you have
just to type :

        (require "slib")

and follow the instructions given in the SLIB library to use a
particular package.

------------------------------

Subject : [3.2] Using lambda as call-backs


Using something like

   (.scrollbar 'configure :command '(lambda (pos) (display pos)))

won't work. This is due to the way Tk and STk communicate. For the
time being the call-back command are stored in strings. When Tk calls
the call-back, the string is sent to STk, if the string doesn't start
with a bracket it is bracketed first. Thus

    :command "callback" is called by (callback args)
    :command '(lambda (pos) ...) is called by (lambda ...) args
      which is obviously false.
    :command "apply (lambda ....)" is called by (apply (lambda..) args)
      which the only current working alternative.

Eventually, this problem will be solved in future release.

------------------------------

Subject : [4.0] STklos: Principle


STklos is the object oriented extension to STk. It is based on
TinyClos. It provides an easy access to Tk widgets in a OO fashion.
It supports a meta-object protocol a la Clos.

------------------------------

Subject : [4.1] STklos: Common traps


There are some limitation in using STklos with Tk. This is inherent
to the way Tk communicate with the underlying interpreter.
Below is the list of known limitations :

   + ....
      [to be completed later]

----------------------------------------


Comment to be directed to Marc.Furrer_at_di.epfl.ch.



--
Furrer Marc 		    EPFL DI-LTI, 1015 Lausanne, Suisse
Marc.Furrer_at_di.epfl.ch      +41 21 693 29 07 / 66 00 (Fax)
                            http://ltiwww.epfl.ch/~furrer
--
You are a wise man my friend.
Not yet sir. But with your help, I am learning.
    -- Riker and Data, "The Measure of a Man", stardate 42523.7
--
PGP 2.6 encrypted mail are welcomed, public key on nearest server
Received on Mon Apr 03 1995 - 15:39:12 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 21 2014 - 19:38:59 CEST