This directory contains a number of sample programs.
After succesfull installation of CHICKEN enter

  make examples

to build the programs. This should work on Linux systems.
If you have trouble with missing X11 libraries, then invoke
make with the actual X11 library path, like this:

  make examples X11LIBPATH=<path>

For Windows systems using Visual C++, enter the following
(make sure the C tools are available at the command line and
that the CHICKEN_HOME environment variable is set):

  nmake -f makefile.vc


A description of the source files follows:


ctclsh		(ctclsh.scm, tclAppInit.c)

  This is a simple embedding of a compiled Scheme program into
  a Tcl shell. The command "chicken" is provided, which evaluates
  the single argument passed to this command:

  % chicken "(+ 3 4)"
  7

  This demonstrates entry points and embedding into other programs.


mandelbrot	(mandelbrot.scm, xc11plot.c, xc11plot.h)

  Shows an X window containing the famous Mandelbrot set.
  A demonstration of FFI facilities.


mmcp		(mmcp.scm)

  A very simple file-copy utility.

  mmcp [-m] FILE1 FILE2

  copies FILE1 to FILE2, if "-m" is given, then memory mapped
  file-copying is performed.
  This demonstrates access to UNIX library calls and the "unistd"
  unit. Note that this program can not be build when the GNU regex
  library is not available.


prolog          (prolog.scm, schelog-support.scm, schelog-macros.scm, nqueens.prolog)

  A user pass for the Chicken compiler that translates a simple subset
  of PROLOG into Scheme and compiles it to C. You can use the user pass
  with the normal compiler, like this:

    chicken nqueens.prolog -extend prolog.scm

  or you can use the generated executable "chicken-prolog":

    chicken-prolog nqueens.prolog

  Compiled PROLOG programs should be linked with the file "schelog-support.o".
  which contains support code. Schelog is an embedding of PROLOG into Scheme,
  written by Dorai Sitaram.
  Note that the file "schelog-macros.scm" should be available in your
  include path, since compiling a PROLOG program needs macro-definitions
  in this file.
  To compile the example file "nqueens.prolog", enter the following commands:

    % chicken-prolog nqueens.prolog -benchmark-mode -block
      [or: chicken nqueens.prolog -extend prolog.scm -benchmark-mode -block]
    % gcc out.c schelog-support.o `chicken-config -cflags -libs`


hellowin	(hellowin.scm)

  Petzold's venerable example program, translated to CHICKEN.


eval-server	(eval-server.scm, eval-client.c)

  A simple example that shows how to create a compiled DLL in Scheme.
  The `eval-client' links with `eval-server.dll', evaluates expressions
  at prints the result.


calendar.scm

  [Contributed by Dale Jordan]
  A SRFI-22 script that displays a calendar for a given year.
  To use it enter "calendar.scm <year>" at the command line.


tcp-server / tcp-client 

  A simple TCP socket demonstration. The client tries to guess a number
  between 1 and 10. Run tcp-server first and the run tcp-client with
  the hostname of the machine on which tcp-server is running.
  When running on the same machine, the hostname can be omitted.
