Changeset 11929 for trunk/source/level-1


Ignore:
Timestamp:
Apr 9, 2009, 11:21:04 PM (11 years ago)
Author:
gb
Message:

New method: CCL:REPL-FUNCTION-NAME (intended to be specialized on
APPLICATION and its subclasses), to make it easier to start applications
that have lisp-like REPLs (that want to run in an environment like the
standard lisp REPL, e.g., in a separate thread, with primary ownership
of terminal input, with the initial thread doing housekeeping, etc.)

APPLICATION's REPL-FUNCTION-NAME method returns NIL.
LISP-DEVELOPMENT-SYSTEM's REPL-FUNCTION-NAME method returns 'LISTENER-FUNCTION
(which runs the standard REPL.)

LISP-DEVELOPMENT-SYSTEM's TOPLEVEL-FUNCTION method creates a listener thread
and calls the application's REPL-FUNCTION-NAME (or NIL).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-application.lisp

    r10942 r11929  
    186186         (set-terminal-encoding (character-encoding-name encoding))))))
    187187
     188(defmethod repl-function-name ((a application))
     189  "Return the name of a function that should be run in a TTY-like
     190listener thread (if that concept makes sense); return NIL otherwise."
     191  nil)
     192
    188193(defmethod application-version-string ((a application))
    189194  "Return a string which (arbitrarily) represents the application version.
     
    268273       
    269274
     275(defmethod repl-function-name ((a lisp-development-system))
     276  'listener-function)
     277
    270278(defmethod toplevel-function ((a lisp-development-system) init-file)
    271   (let* ((sr (input-stream-shared-resource *terminal-input*)))
     279  (let* ((sr (input-stream-shared-resource *terminal-input*))
     280         (f (or (repl-function-name a) 'listener-function)))
    272281    (with-slots (initial-listener-process) a
    273282      (setq initial-listener-process
     
    281290             #'(lambda ()
    282291                 (startup-ccl (and *load-lisp-init-file* init-file))
    283                  (listener-function)
     292                 (funcall f)
    284293                 nil)
    285294             :close-streams nil
Note: See TracChangeset for help on using the changeset viewer.