Next: Introduction, Previous: (dir), Up: (dir) [Contents][Index]
This is the cltcl Reference Manual, version 0.0.1, generated automatically by Declt version 3.0 "Montgomery Scott" on Tue Dec 22 13:06:12 2020 GMT+0.
• Introduction | What cltcl is all about | |
• Systems | The systems documentation | |
• Files | The files documentation | |
• Packages | The packages documentation | |
• Definitions | The symbols documentation | |
• Indexes | Concepts, functions, variables and data types |
Embed Tcl/Tk scripts in Common Lisp
Forked version from lisper99/cltcl in order to get it into QuickLisp.
Documentation from http://lisper99.github.io/cltcl/ added into folder
doc
.
Example package-viewer
slightly modified and added to folder ex
such
that a quick test by (load "package-viewer.lisp")
may be performed. You
probably have to adjust the following paths at the top of the file:
;; Setup QuickLisp and load clTcl
(load "~/quicklisp/setup")
(ql:quickload :cltcl)
;; Define Tcl interpreter
(defparameter *wish* "C:/Tcl/bin/wish86.exe") ;; Windows
; (defparameter *wish* "/usr/bin/wish") ;; Unix
See http://lisper99.github.io/cltcl/examples.html.
Loadable from Quicklisp since 1-NOV-2016
Next: Files, Previous: Introduction, Up: Top [Contents][Index]
The main system appears first, followed by any subsystem dependency.
• The cltcl system |
Paul Griffioen
MIT, see file LICENSE
Embed Tcl/Tk scripts in Common Lisp
0.0.1
cltcl.asd (file)
Files are sorted by type and then listed depth-first from the systems components trees.
• Lisp files |
• The cltcl.asd file | ||
• The cltcl/package.lisp file | ||
• The cltcl/cltcl.lisp file | ||
• The cltcl/communication.lisp file | ||
• The cltcl/protocol.lisp file |
Next: The cltcl/package․lisp file, Previous: Lisp files, Up: Lisp files [Contents][Index]
cltcl.asd
cltcl (system)
Next: The cltcl/cltcl․lisp file, Previous: The cltcl․asd file, Up: Lisp files [Contents][Index]
Next: The cltcl/communication․lisp file, Previous: The cltcl/package․lisp file, Up: Lisp files [Contents][Index]
package.lisp (file)
cltcl (system)
cltcl.lisp
Next: The cltcl/protocol․lisp file, Previous: The cltcl/cltcl․lisp file, Up: Lisp files [Contents][Index]
cltcl.lisp (file)
cltcl (system)
communication.lisp
Previous: The cltcl/communication․lisp file, Up: Lisp files [Contents][Index]
communication.lisp (file)
cltcl (system)
protocol.lisp
Next: Definitions, Previous: Files, Up: Top [Contents][Index]
Packages are listed by definition order.
• The cltcl package |
package.lisp (file)
Definitions are sorted by export status, category, package, and then by lexicographic order.
• Exported definitions | ||
• Internal definitions |
Next: Internal definitions, Previous: Definitions, Up: Definitions [Contents][Index]
• Exported special variables | ||
• Exported macros | ||
• Exported functions |
Next: Exported macros, Previous: Exported definitions, Up: Exported definitions [Contents][Index]
If not nil the commands of a script are send one by one to the interpreter. This eases localization of errors. Default nil.
protocol.lisp (file)
The default Tcl/Tk interpreter. Default value is /usr/bin/wish.
protocol.lisp (file)
A two-way-stream connected to a Tcl/Tk interpreter or NIL if no such interpreter is running. This stream is used by functions CALL, POST and RUN.
protocol.lisp (file)
An integer that determines which events are traced in clTcl’s communication protocol between Lisp and Tcl/Tk. Setting a larger number gives trace messages. Level -1 (the default) is complete silence, level 0 is errors only, level 1 is errors and events, level 2 is errors, events and event details.
protocol.lisp (file)
Next: Exported functions, Previous: Exported special variables, Up: Exported definitions [Contents][Index]
Uses OPEN-TCL/TK-STREAM to start a Tcl/Tk interpreter and connect to it by a two-way stream. Arguments ARGS are used as keyword arguments to OPEN-TCL/TK-STREAM. The forms in BODY are evaluated as an implicit progn with VAR bound to the stream returned by OPEN-TCL/TK-STREAM. When control leaves the body, either normally or abnormally, the stream is closed with CLOSE-TCL/TK-STREAM.
communication.lisp (file)
Previous: Exported macros, Up: Exported definitions [Contents][Index]
Calls Tcl/Tk command COMMAND with arguments ARGS properly escaped. Arguments of type symbol are writting to a string and prefixed with a hyphen to support keyword for Tcl options. Other arguments are written to string if necessary and properly escaped. This function is typically used in a event that was invoked in a clTcl script run by EVENT-LOOP. Sends the command to *STREAM*.
protocol.lisp (file)
Instructs the Tcl/Tk process associated with STREAM to exit and closes the stream. Arguments STREAM must be a stream created by OPEN-TCL/TK-STREAM. This function is implementation dependent.
communication.lisp (file)
Escapes all characters that have a special meaning for Tcl (includes whitespace) with a backslash.
cltcl.lisp (file)
Starts Tcl/Tk interpreter located at INTERPRETER, binds *STREAM* to the stream that connects to Tcl/Tk, binds *INTERPRETER* to INTERPRETER, runs SCRIPT on ARGUMENTS and starts listening on the stream. Use command ’exit’ to end the listener. Establishes a binding for restart KEEP-LISTENING to recover from errors in an event handler. The default value for INTERPRETER is *INTERPRETER. Keyword OPTIONS is passed to the interpreter.
protocol.lisp (file)
Applies function FORMAT to SCRIPT’s commands sequentially. Each element consumes its required formatter arguments from ARGS, leaving the rest of the arguments for the rest of the commands. For clTcl script written with #TCL[...] this gives the effect of a single format on the entire Tcl code.
cltcl.lisp (file)
A restart applicable during errors in events. Transfers control back to Tcl and resumes listening.
protocol.lisp (file)
Starts a Tcl/Tk interpreter and creates and returns a two-way stream connected to this Tcl/Tk process. This function and the meaning of arguments INTERPRETER and OPTIONS are implementation dependent.
communication.lisp (file)
Posts Tcl/Tk command COMMAND with arguments ARGS properly escaped as an event and does not wait for a reply. Arguments of type symbol are writting to a string and prefixed with a hyphen to support keyword for Tcl options. Other arguments are written to string if necessary and properly escaped. Sends the command to *STREAM*.
protocol.lisp (file)
Reads a Tcl list from STREAM. Reads Tcl words until an end of file occurs or READ-WORD finds TERMINATOR (when given), a semi-colon or a newline. The Tcl list is returned as a string. The default value for STREAM is *STANDARD-INPUT*. Returns NIL if end of file is found immediately.
cltcl.lisp (file)
Reads a Tcl script from STREAM. Reads Tcl commands until READ-LIST finds TERMINATOR (when given) or an end of file occurs. Returns the commands as a list of strings. The default value for STREAM is *STANDARD-INPUT*.
cltcl.lisp (file)
Converts Tcl list STRING into a list of strings. Items are delimited by whitespace.
cltcl.lisp (file)
Reads a Tcl word from STREAM and returns it as a string. Reads characters untill the next one is a terminator. The terminator itself is not read. Terminators are TERMINATOR (when given), whitespace or Tcl list terminators. Throws an error if an end of file occurs, unless EOF-ERROR-P is nil, in which case it returns EOF-VALUE. If ECHO-P is non nil then escape characters are not handled and the word is literally copied.
cltcl.lisp (file)
Reads a Tcl list from STREAM including the terminating character. Returns nil if an end of file occurs.
communication.lisp (file)
A read-eval-print loop. Useful for development. Prompts for commands to send to the Tcl/Tk interpreter and prints the reply.
protocol.lisp (file)
Sends SCRIPT via *STREAM* to Tcl/Tk and waits for a reply. This function is typically used in a event that was invoked in a clTcl script run by EVENT-LOOP. Sets Tcl/Tk variable argv to ARGS, properly escaped.
protocol.lisp (file)
Sends clTcl script SCRIPT to a running Tcl/Tk interpreter via stream STREAM. The stream must be one that was opened with OPEN-TCL/TK-STREAM. The script must be a list of strings, each string being a valid Tcl command.
communication.lisp (file)
Converts list to a Tcl string. Nested lists are converted recursively. Strings are escaped. Other values are written to string and escaped.
cltcl.lisp (file)
Previous: Exported definitions, Up: Definitions [Contents][Index]
• Internal functions |
Previous: Internal definitions, Up: Internal definitions [Contents][Index]
Removes all empty strings and comments from command list SCRIPT.
cltcl.lisp (file)
Helper for TEST
protocol.lisp (file)
Helper for TEST
protocol.lisp (file)
Handles EVENT that was read from a Tcl/Tk stream. Calls the requested Lisp function and returns the results. Restart KEEP-LISTENING is available during the event.
protocol.lisp (file)
Sends a message to Tcl/Tk stream to test if it responds. Throws an error when no appropriate message comes back.
protocol.lisp (file)
Receives messages from STREAM until a reply is received. Incoming events and errors are handled. Returns the data from the reply.
protocol.lisp (file)
Writes formatted text to *TRACE-OUTPUT* if LEVEL is at least as high as *TRACE-LEVEL*. Level 0 is for errors, level 1 is for events, level 2 is for event details.
protocol.lisp (file)
The data of the message obtained with RECEIVE-MESSAGE. The contents depends on the type of message.
protocol.lisp (file)
The tag of the message obtained with RECEIVE-MESSAGE. One of the symbols :reply, :event or :error.
protocol.lisp (file)
Reads a Tcl braced expression from STREAM.
cltcl.lisp (file)
Reads a line of Tcl comment from STREAM but leaves the newline.
cltcl.lisp (file)
Reads a Tcl double quoted expression from STREAM.
cltcl.lisp (file)
Reads white space from STREAM, except newlines.
cltcl.lisp (file)
Helper for READ-WORD.
cltcl.lisp (file)
Attempts to read a message from stream. Functions MESSAGE-TAG yields the tag of the message. Function MESSAGE-DATA yields the data. Counterpart of Tcl proc sendMessage
protocol.lisp (file)
Stub to test function REPL. Demonstrates how the repl might be added to an application via an event-handler.
protocol.lisp (file)
Sends a script directly to the Tcl/Tk interpreter and waits for a reply.
protocol.lisp (file)
Sends a script to the listener that triggered the event that triggered this call and waits for a reply. The script is picked up and evaluated by a listener at the Tcl/Tk side.
protocol.lisp (file)
Script that performs command with all arguments safely escaped.
protocol.lisp (file)
Counterpart is Tcl proc receiveMessage
protocol.lisp (file)
Script that creates Tcl procedures in Tcl/Tk to communicate to Lisp.
protocol.lisp (file)
Tests the connection with Tcl/Tk and displays systems
information. Sets *TRACE-LEVEL* to TRACE-LEVEL. The other keywords are
passed to the event handler. See OPEN-TCL/TK-STREAM for allowed
keywords.
protocol.lisp (file)
Escapes all characters that have a special meaning for Tcl (includes whitespace) with a backslash.
cltcl.lisp (file)
Writes character CHAR to stream. Special Tcl escape characters \b, \f, \r,\n and \t are converted.
cltcl.lisp (file)
Converts list to a Tcl string. Nested lists are converted recursively. Strings are escaped. Other values are written to string and escaped.
cltcl.lisp (file)
Previous: Definitions, Up: Top [Contents][Index]
• Concept index | ||
• Function index | ||
• Variable index | ||
• Data type index |
Next: Function index, Previous: Indexes, Up: Indexes [Contents][Index]
Jump to: | C F L |
---|
Jump to: | C F L |
---|
Next: Variable index, Previous: Concept index, Up: Indexes [Contents][Index]
Jump to: | C E F H K L M O P R S T W |
---|
Jump to: | C E F H K L M O P R S T W |
---|
Next: Data type index, Previous: Function index, Up: Indexes [Contents][Index]
Jump to: | *
S |
---|
Jump to: | *
S |
---|
Previous: Variable index, Up: Indexes [Contents][Index]
Jump to: | C P S |
---|
Index Entry | Section | ||
---|---|---|---|
| |||
C | |||
cltcl : | The cltcl system | ||
cltcl : | The cltcl package | ||
| |||
P | |||
Package, cltcl : | The cltcl package | ||
| |||
S | |||
System, cltcl : | The cltcl system | ||
|
Jump to: | C P S |
---|