This is kawa.info, produced by makeinfo version 4.0f from
/home/bothner/Kawa/kawa/doc/kawa.texi.

START-INFO-DIR-ENTRY
* kawa: (kawa).         Kawa, the Java-based Scheme system
END-INFO-DIR-ENTRY


File: kawa.info,  Node: Low-level functions,  Next: XML tools,  Prev: Objects Classes and Modules,  Up: Top

The Scheme-Java interface
*************************

   Kawa has extensive features so you can work with Java objects and
call Java methods.

* Menu:

* Scheme types in Java::
* Array operations::      Low-level operations on Java arrays
* Low-level Method invocation::
* Low-level Field operations::
* Loading Java functions into Scheme::
* Evaluating Scheme expressions from Java::


File: kawa.info,  Node: Scheme types in Java,  Next: Array operations,  Prev: Low-level functions,  Up: Low-level functions

Scheme types in Java
====================

   All Scheme values are implemented by sub-classes of
`java.lang.Object'.

   Scheme symbols are implemented using `java.lang.String'.  (Don't be
confused by the fact the Scheme sybols are represented using Java
Strings, while Scheme strings are represented by `kawa.lang.Scheme'.
It is just that the semantics of Java strings match Scheme symbols, but
do not match mutable Scheme strings.)  Interned symbols are presented
as interned Strings.  (Note that with JDK 1.1 string literals are
automatically interned.)

   Scheme integers are implemented by `gnu.math.IntNum'.  Use the make
static function to create a new IntNum from an int or a long.  Use the
intValue or longValue methods to get the int or long value of an IntNum.

   A Scheme "flonum" is implemented by `gnu.math.DFloNum'.

   A Scheme pair is implemented by `kawa.lang.Pair'.

   A Scheme vector is implemented by `kawa.lang.Vector'.

   Scheme characters are implemented using `kawa.lang.Char'.

   Scheme strings are implemented using `kawa.lang.FString'.

   Scheme procedures are all sub-classes of `kawa.lang.Procedure'.
Normally each function (lambda expression) in the source code is
compiled to a separate sub-class of `Procedure'.  The "action" of a
`Procedure' is invoked by using one of the `apply*' methods:  `apply0',
`apply1', `apply2', `apply3', `apply4', or `applyN'.  Various sub-class
of `Procedure' provide defaults for the various `apply*' methods.  For
example, a `Procedure2' is used by 2-argument procedures.  The
`Procedure2' class provides implementations of all the `apply*' methods
_except_ `apply2', which must be provided by any class that extends
`Procedure2'.


File: kawa.info,  Node: Array operations,  Next: Low-level Method invocation,  Prev: Scheme types in Java,  Up: Low-level functions

Low-level Operations on Java Arrays
===================================

   The following macros evaluate to procedures that can be used to
manipulate primitive Java array objects.  The compiler can inline each
to a single bytecode instruction (not counting type conversion).

 - Syntax: primitive-array-new element-type
     Evaluates to a one-argument procedure.  Applying the resulting
     procedure to an integer count allocates a new Java array of the
     specified length, and whose elements have type ELEMENT-TYPE.

 - Syntax: primitive-array-set element-type
     Evaluates to a three-argument procedure.  The first argument of
     the resulting procedure must be an array whose elements have type
     ELEMENT-TYPE;  the second argument is an index;  and the third
     argument is a value (coercible to ELEMENT-TYPE) which replaces the
     value specified by the index in the given array.

 - Syntax: primitive-array-get element-type
     Evaluates to a two-argument procedure.  The first argument of the
     resulting procedure must be an array whose elements have type
     ELEMENT-TYPE;  the second argument is an index.  Applying the
     procedure returns the element at the specified index.

 - Syntax: primitive-array-length element-type
     Evaluates to a one-argument procedure.  The argument of the
     resulting procedure must be an array whose elements have type
     ELEMENT-TYPE.  Applying the procedure returns the length of the
     array.  (Alternatively, you can use `(field ARRAY 'length)'.)


File: kawa.info,  Node: Low-level Method invocation,  Next: Low-level Field operations,  Prev: Array operations,  Up: Low-level functions

Low-level Method invocation
===========================

   The following lower-level primitives require you to specify the
parameter and return types explicitly.  Type specifications are
currently required to be string literals or one of the standard types
(*note Standard Types::).

 - Syntax: primitive-constructor class (argtype ...)
     Returns a new anonymous procedure, which when called will create a
     new object of the specified class, and will then call the
     constructor matching the specified argument types.

 - Syntax: primitive-virtual-method class method rtype (argtype ...)
     Returns a new anonymous procedure, which when called will invoke
     the instance method whose name is the string METHOD in the class
     whose name is CLASS.

 - Syntax: primitive-static-method class method rtype (argtype ...)
     Returns a new anonymous procedure, which when called will invoke
     the static method whose name is the string METHOD in the class
     whose name is CLASS.

 - Syntax: primitive-interface-method interface method rtype (argtype
          ...)
     Returns a new anonymous procedure, which when called will invoke
     the matching method from the interface whose name is INTERFACE.

   The macros return procedure values, just like `lambda'.  If the
macros are used directly as the procedure of a procedure call, then
kawa can inline the correct bytecodes to call the specified methods.
(Note also that neither macro checks that there really is a method that
matches the specification.)  Otherwise, the Java reflection facility is
used.


File: kawa.info,  Node: Low-level Field operations,  Next: Loading Java functions into Scheme,  Prev: Low-level Method invocation,  Up: Low-level functions

Low-level Operations on Object Fields
=====================================

   The following macros evaluate to procedures that can be used to
access or change the fields of objects or static fields.  The compiler
can inline each to a single bytecode instruction (not counting type
conversion).

   These macros are deprecated.  The `fields' and `static-field'
functions (*note Field operations::) are easier to use, more powerful,
and just as efficient.  (One exception is for `primitive-set-static';
while its functionality can be expressed using `(set! (static-field
...) ...)', that idiom is currently less efficient.)  Also, the
high-level functions currently do not provide access to private fields.

 - Syntax: primitive-get-field class fname ftype
     Use this to access a field named FNAME having type TYPE in class
     CLASS.  Evaluates to a new one-argument procedure, whose argument
     is a reference to an object of the specified CLASS.  Calling that
     procedure returns the value of the specified field.

 - Syntax: primitive-set-field class fname ftype
     Use this to change a field named FNAME having type TYPE in class
     CLASS.  Evaluates to a new two-argument procedure, whose first
     argument is a reference to an object of the specified CLASS, and
     the second argument is the new value.  Calling that procedure sets
     the field to the specified value.  (This macro's name does not end
     in a `!', because it does not actually set the field.  Rather, it
     returns a function for setting the field.)

 - Syntax: primitive-get-static class fname ftype
     Like `primitive-get-field', but used to access static fields.
     Returns a zero-argument function, which when called returns the
     value of the static field.

 - Syntax: primitive-set-static class fname ftype
     Like `primitive-set-field', but used to modify static fields.
     Returns a one-argument function, which when called sets the value
     of the static field to the argument.


File: kawa.info,  Node: Loading Java functions into Scheme,  Next: Evaluating Scheme expressions from Java,  Prev: Low-level Field operations,  Up: Low-level functions

Loading Java functions into Scheme
==================================

   When `kawa -C' compiles (*note Files compilation::) a Scheme module
it creates a class that implements the `java.lang.Runnable' interface.
(Usually it is a class that extends the `gnu.expr.ModuleBody'.)  It is
actually fairly easy to write similar "modules" by hand in Java, which
is useful when you want to extend Kawa with  new "primitive functions"
written in Java.  For each function you need to create an object that
extends `gnu.mapping.Procedure', and then bind it in the global
environment.  We will look at these two operations.

   There are multiple ways you can create a `Procedure' object.  Below
is a simple example, using the `Procedure1' class, which is class
extending `Procedure' that can be useful for one-argument procedure.
You can use other classes to write procedures.  For example a
`ProcedureN' takes a variable number of arguments, and you must define
`applyN(Object[] args)' method instead of `apply1'.  (You may notice
that some builtin classes extend `CpsProcedure'.  Doing so allows has
certain advantages, including support for full tail-recursion, but it
has some costs, and is a bit trickier.)

     import gnu.mapping.*;
     import gnu.math.*;
     public class MyFunc extends Procedure1
     {
       // An "argument" that is part of each procedure instance.
       private Object arg0;
     
       public MyFunc(String name, Object arg0)
       {
         super(name);
         this.arg0 = arg0;
       }
     
       public Object apply1 (Object arg1)
       {
         // Here you can so whatever you want. In this example,
         // we return a pair of the argument and arg0.
         return gnu.lists.Pair.make(arg0, arg1);
       }
     }

   You can create a `MyFunc' instance and call it from Java:
       Procedure myfunc1 = new MyFunc("my-func-1", Boolean.FALSE);
       Object aresult = myfunc1.apply1(some_object);
   The name `my-func-1' is used when `myfunc1' is printed or when
`myfunc1.toString()' is called.  However, the Scheme variable
`my-func-1' is still not bound.  To define the function to Scheme, we
can create a "module", which is a class intended to be loaded into the
top-level environment.  The provides the definitions to be loaded, as
well as any actions to be performed on loading

     public class MyModule
     {
       // Define a function instance.
       public static final MyFunc myfunc1
         = new MyFunc("my-func-1", IntNum.make(1));
     }

   If you use Scheme you can use `require':
     #|kawa:1|# (require <MyModule>)
     #|kawa:2|# (my-func-1 0)
     (1 0)

   Note that `require' magically defines `my-func-1' without you
telling it to.  For each public final field, the name and value of the
field are entered in the top-level environment when the class is
loaded.  (If there are non-static fields, or the class implements
`Runnable', then an instance of the object is created, if one isn't
available.)  If the field value is a `Procedure' (or implements
`Named'), then the name bound to the procedure is used instead of the
field name.  That is why the variable that gets bound in the Scheme
environment is `my-func-1', not `myfunc1'.

   Instead of `(require <MyModule>)', you can do `(load "MyModule")' or
`(load "MyModule.class")'.  If you're not using Scheme, you can use
Kawa's `-f' option:
     $ kawa -f MyModule --xquery --
     #|kawa:1|# my-func-1(3+4)
     <list>1 7</list>

   If you need to do some more complex calculations when a module is
loaded, you can put them in a `run' method, and have the module
implement `Runnable':

     public class MyModule implements Runnable
     {
       public void run ()
       {
         Interpreter interp = Interpreter.getInterpreter();
         Object arg = Boolean.TRUE;
         interp.defineFunction (new MyFunc ("my-func-t", arg));
         System.err.println("MyModule loaded");
       }
     }

   Loading `MyModule' causes `"MyModule loaded"' to be printed, and
`my-func-t' to be defined.  Using `Interpreter''s `defineFunction'
method is recommended because it does the righ things even for
languages like Common Lisp that use separate "namespaces" for variables
and functions.

   A final trick is that you can have a `Procedure' be its own module:

     import gnu.mapping.*;
     import gnu.math.*;
     public class MyFunc2 extends Procedure2
     {
       public MyFunc(String name)
       {
         super(name);
       }
     
       public Object apply2 (Object arg1, arg2)
       {
         return gnu.lists.Pair.make(arg1, arg2);
       }
     
       public static final MyFunc myfunc1 = new MyFunc("my-func-2);
     }


File: kawa.info,  Node: Evaluating Scheme expressions from Java,  Prev: Loading Java functions into Scheme,  Up: Low-level functions

Evaluating Scheme expressions from Java
=======================================

   The following methods are recommended if you need to evaluate a
Scheme expression from a Java method.  (Some details (such as the
`throws' lists) may change.)

 - Static method: void Scheme.registerEnvironment ()
     Initializes the Scheme environment.  Maybe needed if you try to
     load a module compiled from a Scheme source file.

 - Static method: Object Scheme.eval (InPort PORT, Environment ENV)
     Read expressions from PORT, and evaluate them in the ENV
     environment, until end-of-file is reached.  Return the value of
     the last expression, or `Interpreter.voidObject' if there is no
     expression.

 - Static method: Object Scheme.eval (String STRING, Environment ENV)
     Read expressions from STRING, and evaluate them in the ENV
     environment, until the end of the string is reached.  Return the
     value of the last expression, or `Interpreter.voidObject' if there
     is no expression.

 - Static method: Object Scheme.eval (Object SEXPR, Environment ENV)
     The SEXPR is an S-expression (as may be returned by `read').
     Evaluate it in the ENV environment, and return the result.

   For the `Environment' in most cases you could use
`Environment.current()'.  Before you start, you need to initialize the
global environment, which you can with
     Environment.setCurrent(new Scheme().getEnvironment());

   Alternatively, rather than setting the global environment, you can
use this style:
     Scheme scm = new Scheme();
     Object x = scm.eval("(+ 3 2)");
     System.out.println(x);


File: kawa.info,  Node: XML tools,  Next: KRL,  Prev: Low-level functions,  Up: Top

Tools for working with XML and HTML
***********************************

   Kawa has a number of experimental features for working with XML.
These are built on the concepts of the `gnu.lists' package.

* Menu:

* Server-side scripts::  Writing web-server-side Kawa scripts
* Servlets::             Installing Kawa programs as Servlets
* CGI scripts::          Installing Kawa programs as CGI scripts
* HTTP requests::        Functions for accessing HTTP requests
* HTTP response::        Functions for generating HTTP response

Scheme functions
----------------

 - Function: make-element tag [attribute ...] child ...
     Create a representation of a XML element, corresponding to
          <TAG ATTRIBUTE...>CHILD...</TAG>
     The result is a `TreeList', though if the result context is a
     consumer the result is instead "written" to the consumer.  Thus
     nested calls to `make-element' only result in a single `TreeList'.
     More generally, whether an ATTRIBUTE or CHILD is includded by
     copying or by reference is (for now) undefined.  The TAG should
     currently be a symbol, though in the future it should be a
     qualified name.  An ATTRIBUTE is typically a call to
     `make-attribute', but it can be any attribute-valued expression.
          (make-element 'p
          	      "The time is now: "
          	      (make-element 'code (make <java.util.Date>)))

 - Function: make-attribute name value...
     Create an "attribute", which is a name-value pair.  For now, NAME
     should be a symbol

xquery language
---------------

   W3C is working an an XML Query language
(http://www.w3c.org/XML/Query), and a draft has been released.  If you
start Kawa with the `--xquery' it selects the "XQuery" source language;
this also prints output using XML syntax.  See the Kawa-XQuery home
page (http://www.gnu.org/software/kawa/xquery/) for examples and more
information.


File: kawa.info,  Node: Server-side scripts,  Next: Servlets,  Up: XML tools

Writing web-server-side Kawa scripts
====================================

   You can take a Kawa program, in any supported language, and run it
as either servlet engine (using a web server that supports servlets),
or as a "CGI script" on most web servers.

   Here is a simple program `hello.scm':
     (require 'http) ; Required for Scheme, though not BRL/KRL.
     (response-content-type 'text/html) ; Optional
     (make-element 'p
       "The request URL was: " (request-url))
     (make-element 'p
       (let ((query (request-query-string)))
         (if query
           (values-append "The query string was: " query)
           "There was no query string.")))
     #\newline ; emit a new-line at the end

   The same program using KRL is shorter:
     <p>The request URL was: [(request-url)]</p>,
     <p>[(let ((query (request-query-string)))
         (if query
           (begin ]The query string was: [query)
           ]There was no query string.[))]</p>

   You can also use XQuery:
     <p>The request URL was: {request-url()}</p>
     <p>{let $query := request-query-string() return
         if ($query)
         then ("The query string was: ",$query)
         else "There was no query string."}</p>

   Either way, you compile your program to a servlet:
     kawa --servlet -C hello.scm
   or:
     kawa --servlet --krl -C hello.krl
   or:
     kawa --servlet --xquery -C hello.xql

   The next two sections will explain how you can install this script
as either a servlet or a CGI script.


File: kawa.info,  Node: Servlets,  Next: CGI scripts,  Prev: Server-side scripts,  Up: XML tools

Installing Kawa programs as Servlets
====================================

   You can compile a Scheme file to a `Servlet', and run it in a
servlet engine (a Servlet-aware web server).  I assume you have
compiled your program to a servlet as descrbibed in the previous
section.

   If you have Tomcat 4.x installed, and you want `hello' to be part of
the `myutils' "web application", copy `hello*.class' into
`$CATALINA_HOME/webapps/myutils/WEB-INF/classes/'.  You also need to
copy Kawa somewhere where Tomcat can find it, for example
`$CATALINA_HOME/lib/kawa-1.6.98.jar'.  You can then run the `hello'
servlet using the URL <http://localhost:8080/myutils/servlet/hello>.


File: kawa.info,  Node: CGI scripts,  Next: HTTP requests,  Prev: Servlets,  Up: XML tools

Installing Kawa programs as CGI scripts
=======================================

   The recommended way to have a web-server run a Kawa program as a CGI
script is to compile the Kawa program to a servlet (as explained in
*Note Server-side scripts::, and then use Kawa's supplied
CGI-to-servlet bridge.

   First, compile your program to one or more class files as explain in
*Note Server-side scripts::.  For example:
     kawa --servlet --xquery -C hello.xql

   Then copy the resulting `.class' files to your server's CGI
directory.  On Red Hat GNU/Linux, you can do the following (as root):
     cp hello*.class /var/www/cgi-bin/

   Next find the `cgi-servlet' program that Kawa builds and installs.
If you installed Kawa in the default place, it will be in
`/usr/local/bin/cgi-servlet'.  (You'll have this if you installed Kawa
from source, but not if you're just using Kawa `.jar' file.)  Copy this
program into the same CGI directory:
     cp /usr/local/bin/cgi-servlet /var/www/cgi-bin/

   You can link instead of copying:
     ln -s /usr/local/bin/cgi-servlet /var/www/cgi-bin/
   However, because of security issues this may not work, so it is
safer to copy the file.  However, if you already have a copy of
`cgi-servlet' in the CGI-directory, it is safe to make a hard link
instead of making an extra copy.

   Make sure the files have the correct permissions:
     chmod a+r /var/www/cgi-bin/hello*.class /var/www/cgi-bin/hello
     chmod a+x /var/www/cgi-bin/hello

   Now you should be able to run the Kawa program, using the URL
<http://localhost/cgi-bin/hello>.  It may take a few seconds to get the
reply, mainly because of the start-up time of the Java VM.  That is why
servlets are preferred.  Using the CGI interface can still be useful
for testing or when you can't run servlets.  We hope to soon be able to
run Kawa CGI scripts compiled using GCJ, which should have much reduced
start-up time, making Kawa servlets more practical.


File: kawa.info,  Node: HTTP requests,  Next: HTTP response,  Prev: CGI scripts,  Up: XML tools

Functions for accessing HTTP requests
=====================================

   The following functions are useful for accessing properties of a HTT
request, in a Kawa program that is run either as a servlet or a CGI
script.  These functions can be used from plain Scheme, from KRL
(whether in BRL-compatible mode or not), and from XQuery.

   If using plain Scheme, you need to do the following before using
these functions.
     (require 'http)
   This is not needed for KRL or XQuery.

 - Function: request-method
     Returns the method of the HTTP request, usually `"GET"' or
     `"POST"'.  Corresponds to the CGI variable `REQUEST_METHOD'.

 - Function: request-path-info
     Corresponds to the CGI variable `PATH_INFO'.

 - Function: request-path-translated
     Corresponds to the CGI variable `PATH_TRANSLATED'.

 - Function: request-uri
     Returns the URI of the request, not including the query string, or
     server specification.  The is the combination of CGI variables
     `SCRIPT_NAME' and `PATH_INFO'.

 - Function: request-url
     Returns the complete URL of the request, except the query string.

 - Function: request-query-string
     Returns the query string from an HTTP request.  The query string is
     the part of the request URL after a quetion mark.  Returns false
     if there was no query string.  Corresponds to the CGI variable
     `QUERY_STRING'.


File: kawa.info,  Node: HTTP response,  Prev: HTTP requests,  Up: XML tools

Functions for generating HTTP responses
=======================================

 - Function: unescaped-data data
     Creates a special value which causes `data' to be printed, as is,
     without normal escaping.  For example, when the output format is
     XML, then printing `"<?xml?>"' prints as `&lt;?xml?&gt;', but
     `(unescaped-data "<?xml?>")' prints as  `<?xml?>'.

   If using plain Scheme, you need to do the following before using
these functions.
     (require 'http)
   This is not needed for KRL or XQuery.

 - Function: response-header key value
     Create the response header `KEY: VALUE' in the HTTP response.  The
     result is a "response header value" (of some unspecified type).
     It does not directly set or print a response header, but only does
     so when you actually "print" its value to the response output
     stream.

 - Function: response-content-type type
     Species the content-type of the result - for example
     `"text/plain"'.  Convenience function for `(response-header
     "Content-Type" TYPE)'.


File: kawa.info,  Node: KRL,  Next: Mailing lists,  Prev: XML tools,  Up: Top

KRL - The Kawa Report Language for generating XML/HTML
******************************************************

   KRL (the "Kawa Report Language") is powerful Kawa dialect for
embedding Scheme code in text files such as HTML or XML templates.  You
select the KRL language by specifying `--krl' on the Kawa command line.

   KRL is based on on BRL (http://brl.sourceforge.net/), Bruce Lewis's
"Beautiful Report Language", and uses some of BRL's code, but there are
some experimental differences, and the implementation core is
different.  You can run KRL in BRL-compatility-mode by specifying
`--brl' instead of `--krl'.

Differences between KRL and BRL
===============================

   This section summarizes the known differences between KRL and BRL.
Unless otherwise specified, KRL in BRL-compatibility mode will act as
BRL.

   * In BRL a normal Scheme string `"mystring"' is the same as the
     inverted quote string `]mystring[', and both are instances of the
     type `<string>'.  In KRL `"mystring"' is a normal Scheme string of
     type `<string>', but `]mystring[' is special type that suppresses
     output escaping.

   * When BRL writes out a string, it does not do any processing of to
     escape special characters like `<'.  However, KRL in its default
     mode does normally ecsape characters and strings.  Thus `"<a>"' is
     written as `&lt;a&gr;'.  You can stop it from doing this by
     overriding the output format, for example by specifying
     `--output-format scheme' on the Kawa command line.

   * Various Scheme syntax forms, including `lambda', take a `<body>',
     which is a list of one or more declarations and expressions.  In
     normal Scheme and in BRL the value of a `<body>') is the value of
     the last expression.  In KRL the value of a `<body>') is the
     concatenation of all the values of the expressions, as if using
     `values-append'

   * In BRL a word starting with a colon is a keyword.  In KRL a word
     starting with a colon is an identifier, which by default is bound
     to the `make-element' function specialized to take the rest of the
     word as the tag name (first argument).

   * BRL has an extensive utility library.  This has not yet been ported
     to KRL, even in BRL-compatibility mode.


File: kawa.info,  Node: Mailing lists,  Next: Support,  Prev: KRL,  Up: Top

Mailing lists
*************

   If you have a problem installing or using Kawa, send mail to
`kawa@sources.redhat.com'

   This mailing list is used for reporting bugs, patches, discussing
changes to Kawa, and announcing snapshots.  If you wish to subscribe,
send a blank message request to `kawa-subscribe@sources.redhat.com'.
To unsubscribe, send a blank message to
`kawa-unsubscribe@sources.redhat.com'.  (If your mail is forwarded,
send mail to the address following `mailto:' in the `List-Unsubscribe'
line in the messages you get from the list.)

   Messages to the mailing list are now archived
(http://sources.redhat.com/ml/kawa/).

   There is a separate mailing list for JEmacs (http://www.JEmacs.net).
See the information page
(http://lists.sourceforge.net/mailman/listinfo/jemacs-info).


File: kawa.info,  Node: Support,  Next: Projects,  Prev: Mailing lists,  Up: Top

Technical Support for Kawa
**************************

   If you have a project that depends on Kawa or one of its component
packages, you might do well get get paid priority support from Kawa's
author.

   The base price is $2400 for one year.  This entitles you to basic
support by email or phone.  Per <per@bothner.com> will answer techical
questions about Kawa or its implementation, investigate bug reports, and
suggest work-arounds.  I may (at my discretion) provide fixes and
enhancements (patches) for simple problems.  Reponse for support
requests received using the day (California time) will normally be
within a few hours.

   All support requests must come through a single designated contact
person.  If Kawa is important to your business, you probably want at
least two contact people, doubling the price.

   If the support contract is cancelled (by either party), remaining
time will be prorated and refunded.

   Per is also available for development projects.


File: kawa.info,  Node: Projects,  Next: License,  Prev: Support,  Up: Top

Projects using Kawa
*******************

   JEmacs is included in the Kawa distribution.  It is a project to
re-implement Emacs, allowing a mix of Java. Scheme, and Emacs Lisp.  It
has its own home-page (http://www.jemacs.net/).

   BRL ("the Beautiful Report Language") is a database-oriented language
to embed in HTML and other markup.  BRL (http://brl.sourceforge.net/)
allows you to embed Scheme in a an HTML file on a web server.

   The Health Media Research Laboratory, part of the Comprehensive
Cancer Center at the University of Michigan, is using Kawa as an
integral part of its core tailoring technologies. Java programs using
Kawa libraries are used to administer customized web-based surveys,
generate tailored feedback, validate data, and "characterize," or
transform, data. Kawa code is embedded directly in XML-formatted
surveys and data dictionaries. Performance and ease of implementation
has far exceeded expectations. For more information contact Paul R.
Potts, Technical Director, Health Media Research Lab,
`<potts@umich.edu>'.

   Mike Dillon (`mdillon@gjt.org') did the preliminary work of creating
a Kawa plugin for jEdit. It is called SchemeShell and provides a REPL
inside of the jEdit console for executing expressions in Kawa (much as
the BeanShell plugin does with the BeanShell scripting language).  It
is currently available only via CVS from:
     CVSROOT=:pserver:anonymous@cvs.jedit.sourceforge.net:/cvsroot/jedit
     MODULE=plugins/SchemeShell

   STMicroelectronics (`marco.vezzoli@st.com') uses Kawa in a prototypal
intranet 3tier information retrival system as a communication protocol
between server and clients and to do server agents programming.

   The Nice Programming Language is an open source research language
that has a Java-like syntax.  It features multiple dispatch methods,
parametric types, higher-order functions, tuples, ..., and the new
concept of "abstract interfaces".  The Nice compiler (`nicec') uses
Kawa's `gnu.expr' and `gnu.bytecode' packages to generate Java bytecode.
You can find more about Nice at `http://nice.sourceforge.net'.  For
more information feel free to contact Daniel Bonniot
(`d.bonniot@mail.dotcom.fr').


File: kawa.info,  Node: License,  Next: Index,  Prev: Projects,  Up: Top

License
*******

License for the Kawa software
=============================

   The license for Kawa and the packages it depends on is a "modified
Gnu Public License".  You can find it in the file `COPYING' in the Kawa
sources, and also quoted here:.

     The Java classes (with related files and documentation) in these packages
     are copyright (C) 1996, 1997, 1998, 1999  Per Bothner.
     
     These classes are distributed in the hope that they will be useful,
     but WITHOUT ANY WARRANTY; without even the implied warranty of
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     GNU General Public License for more details.
     
     These classes are free software.  You can use and re-distribute a class
     without restriction (in source or binary form) as long as you use a
     version that has not been modified in any way from a version released
     by Per Bothner, Red Hat inc, or the Free Software Foundation.
     You may make and distribute a modified version, provided you follow
     the terms of the GNU General Public License; either version 2,
     or (at your option) any later version.

   The file `COPYING' also contains a copy of the GNU General Public
License version 2.

   People have asked what the Kawa license means in practice.
Informally, you get to pick between these choices:
  1. Use Kawa as distributed by Per Bothner, Red Hat Inc, or the Free
     Software Foundation (or their approved agents), with no
     modifications.  In that case, you can use Kawa for any purpose you
     like, and distribute your application with any license you like.
     (This basically gives you the same rights as a typical commercial
     royalty-free re-distribution license.)

  2. Obey the terms of the standard Gnu Public License.  (See
     `http://www.gnu.org/copyleft/gpl.html').  Informally, this means
     that if you distribute any application that is based on Kawa, you
     must also make available to all your recipients (customers) the
     source code for your entire application, giving them the
     modification and re-distribution rights they have under the GPL.
     In a Java context, I take "entire application" to mean all classes
     (and native code) that run in the same Java virtual machine,
     except for the Java runtime system itself (the virtual machine,
     low-level run-time system, and any classes in a `java' or `javax'
     package).

  3. If you need to make a change to Kawa, you can submit them to Per
     Bothner, and convince him to include them in future Kawa releases.

  4. You can negotiate some other (commercial) license with Per Bothner.

   In general, if the license of Kawa or associated packages causes
difficulties, let me know.

Copyright for this manual
=========================

   Here is the license for this manual:

   Copyright (C) 1996, 1997, 1998, 1999 Per Bothner
Parts of this manual were derived from the SLIB manual, copyright (C)
1993-1998 Todd R. Eigenschink and Aubrey Jaffer.
Parts of this manual were derived from ISO/EIC 10179:1996(E) (Document
Style and Specifical Language) - unknown copyright.

   Permission is granted to make and distribute verbatim copies of this
manual provided the copyright notice and this permission notice are
preserved on all copies.

   Permission is granted to copy and distribute modified versions of
this manual under the conditions for verbatim copying, provided that
the entire resulting derived work is distributed under the terms of a
permission notice identical to this one.

   Permission is granted to copy and distribute translations of this
manual into another language, under the above conditions for modified
versions, except that this permission notice may be stated in a
translation approved by the author.

   This manual has quoted from SRFI-6, which is Copyright (C) William D
Clinger (1999). All Rights Reserved.

   The following notice applies to SRFI-6 and SRFI-11, which is quoted
in this manual, but it does not apply to the manual as a whole:

     This document and translations of it may be copied and furnished to
     others, and derivative works that comment on or otherwise explain
     it or assist in its implementation may be prepared, copied,
     published and distributed, in whole or in part, without
     restriction of any kind, provided that the above copyright notice
     and this paragraph are included on all such copies and derivative
     works. However, this document itself may not be modified in any
     way, such as by removing the copyright notice or references to the
     Scheme Request For Implementation process or editors, except as
     needed for the purpose of developing SRFIs in which case the
     procedures for copyrights defined in the SRFI process must be
     followed, or as required to translate it into languages other than
     English.

