Docjar: A Java Source and Docuemnt Enginecom.*    java.*    javax.*    org.*    all    new    plug-in

Quick Search    Search Deep
Class SilkCompleter  view SilkCompleter download

All Implemented Interfaces:

public class SilkCompleter
extends java.lang.Object
implements org.gnu.readline.ReadlineCompleter

This completer works with the JScheme scheme interpreter by looking up symbols in the global namespace. You can register it with the Java Readline library either in Java or in scheme. Something like the following should do it:

        ;;; Switches JScheme's input port to a new one that uses
        ;;; a ReadlineReader with a ">" prompt.
        ;;; (Note that on some systems, you might get a double
        ;;; prompt "> >" because JScheme's main loop also prints
        ;;; a prompt. If this bugs you a lot, you can just write your
        ;;; own main loop to replace jsint.Scheme.readEvalWriteLoop().)
        (set! jsint.Scheme.input$ (jsint.InputPort.
                (org.gnu.readline.ReadlineReader. "> "

        ;;; not sure that this helps a lot, but I suppose it's good practice...
        (.addShutdownHook (Runtime.getRuntime)
                (Thread. (lambda ()
                        (display "cleaning up readline.\n")

        ;;; set Readline's completer to a new Scheme-aware one
        (org.gnu.readline.Readline.setCompleter (
Author: Samer Abdallah ( November 2002

Field Summary
(package private)  java.util.Iterator it
Constructor Summary
Method Summary
 java.lang.String completer(java.lang.String text, int state)
          Implementation of abstract function.
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

Field Detail


java.util.Iterator it
Constructor Detail


public SilkCompleter()
Method Detail


public java.lang.String completer(java.lang.String text,
                                  int state)
Implementation of abstract function. Finds possible completions of the given text.

Specified by:
completer in interface org.gnu.readline.ReadlineCompleter