The text-query Reference Manual

Table of Contents

Next: , Previous: , Up: (dir)   [Contents][Index]

The text-query Reference Manual

This is the text-query Reference Manual, version 1.1, generated automatically by Declt version 2.4 "Will Decker" on Wed Jun 20 12:39:46 2018 GMT+0.


Next: , Previous: , Up: Top   [Contents][Index]

1 Introduction

Short Description
-----------------

This is a generalized form of Y-OR-N-P and YES-OR-NO-P, adding more
generality and the ability to time out with a default value.


Author's Description
--------------------

The QUERY package generalizes the capabilities of the Lisp functions
Y-OR-N-P and YES-OR-NO-P, and is similar in many ways to the Symbolics
FQUERY function. There are several major differences, one of which is QUERY's
ability to timeout with a default value. In addition to redefining Y-OR-N-P
and YES-OR-NO-P in terms of QUERY, this package defines Y-OR-N-P-WAIT and
YES-OR-NO-P-WAIT to illustrate the timeout capability. More complicated
queries are possible using the QUERY function.


Packager's Notes
----------------

This is old code, from 1993, but it is good ANSI Common Lisp. It compiles
and runs well under SBCL and should work in any modern Lisp implementation.

Please see the source code for documentation, since it contains plenty
of comments, docstrings, and examples.

-Peter Scott, October 2004


Acknowledgements
----------------

This code was entirely written by Mark Kantrowitz and made available to us
because of his generosity. Peter Scott, the maintainer of this package, would
not be so presumptious to take credit for anything other than the asdf
packaging.

Next: , Previous: , Up: Top   [Contents][Index]

2 Systems

The main system appears first, followed by any subsystem dependency.


Previous: , Up: Systems   [Contents][Index]

2.1 text-query

Maintainer

Peter Scott <sketerpot@gmail.com>

Author

Mark Kantrowitz

License

Free use, modification, and distribution. Copyright 1993 by Mark Kantrowitz.

Description

A general text-based system for querying the user.

Version

1.1

Source

text-query.asd (file)

Components

Next: , Previous: , Up: Top   [Contents][Index]

3 Files

Files are sorted by type and then listed depth-first from the systems components trees.


Next: , Previous: , Up: Files   [Contents][Index]

3.1 Lisp


Next: , Previous: , Up: Lisp files   [Contents][Index]

3.1.1 text-query.asd

Location

text-query.asd

Systems

text-query (system)

Packages

text-query-system


Previous: , Up: Lisp files   [Contents][Index]

3.1.2 text-query/text-query.lisp

Parent

text-query (system)

Location

text-query.lisp

Packages

text-query

Exported Definitions
Internal Definitions

Previous: , Up: Files   [Contents][Index]

3.2 Doc


Previous: , Up: Doc files   [Contents][Index]

3.2.1 text-query/README

Parent

text-query (system)

Location

README


Next: , Previous: , Up: Top   [Contents][Index]

4 Packages

Packages are listed by definition order.


Next: , Previous: , Up: Packages   [Contents][Index]

4.1 text-query-system

Source

text-query.asd

Use List

Previous: , Up: Packages   [Contents][Index]

4.2 text-query

Source

text-query.lisp (file)

Use List

common-lisp

Exported Definitions
Internal Definitions

Next: , Previous: , Up: Top   [Contents][Index]

5 Definitions

Definitions are sorted by export status, category, package, and then by lexicographic order.


Next: , Previous: , Up: Definitions   [Contents][Index]

5.1 Exported definitions


Previous: , Up: Exported definitions   [Contents][Index]

5.1.1 Functions

Function: query OPTIONS &optional FORMAT-STRING &rest FORMAT-ARGUMENTS

QUERY is used for asking questions of the user. OPTIONS is a property-list containing the following keywords:
:TYPE :char or :line (how *query-io* is read)
:CHOICES A list containing entries of the form
(<value> . <key>*) or ((<value> <print>) . <key>*), where <value> is the value to be returned, <key> is a character or string, as the case may be, that is used to select the <value>, and <print> is printed when the value is selected.
:BEEP Specifies whether to ring the bell.
:CLEAR-INPUT If T, does a clear-input before querying. :FRESH-LINE If T, starts on a fresh line before printing
the prompt.
:LIST-CHOICES If T, prints a list of the choices after the prompt. :HELP-STRING A string to be printed if the user asks for help. :TIMEOUT The number of seconds to wait, if using timeouts. :TIMEOUT-DEFAULT The default value to use if the query times out. :STREAM The stream to use. Defaults to *query-io* :SIGNAL-CONDITION If T, will signal a condition of type QUERY-ERROR before proceeding. If non-NIL but not T, uses the value as the name of the condition. :EOF-ERROR-P If T (the default), signals an error if eof is reached. If NIL, returns EOF-VALUE upon reaching eof :EOF-VALUE Value returned if eof is reached and eof-error-p is NIL.

Package

text-query

Source

text-query.lisp (file)

Function: y-or-n-p &optional FORMAT-STRING &rest FORMAT-ARGUMENTS

Y-OR-N-P prints the message, if supplied, and reads a character from *QUERY-IO* until the user types a Y or an N, returning T and NIL, respectively. Repeats the request if the user typed anything else. Also, if a H or ? is enterred, prints a brief help message. If you want a question mark at the end of the message, you must put it there yourself; Y-OR-N-P will not add it.

Package

text-query

Source

text-query.lisp (file)

Function: y-or-n-p-wait &optional DEFAULT TIMEOUT FORMAT-STRING &rest FORMAT-ARGUMENTS

Y-OR-N-P-WAIT is like Y-OR-N-P, but will timeout after TIMEOUT seconds with DEFAULT as the default value.

Package

text-query

Source

text-query.lisp (file)

Function: yes-or-no-p &optional FORMAT-STRING &rest FORMAT-ARGUMENTS

YES-OR-NO-P prints the message, if supplied, rings the bell, and reads a line from *QUERY-IO* (ignoring whitespace) until the user types YES or NO, returning T and NIL, respectively. Repeats the request if the user typed anything else. Also, if HELP, H or ? is enterred, prints a brief help message. If you want a question mark at the end of the message, you must put it there yourself; YES-OR-NO-P will not add it.

Package

text-query

Source

text-query.lisp (file)

Function: yes-or-no-p-wait &optional DEFAULT TIMEOUT FORMAT-STRING &rest FORMAT-ARGUMENTS

YES-OR-NO-P-WAIT is like YES-OR-NO-P, but will timeout after TIMEOUT seconds with DEFAULT as the default value.

Package

text-query

Source

text-query.lisp (file)


Previous: , Up: Definitions   [Contents][Index]

5.2 Internal definitions


Next: , Previous: , Up: Internal definitions   [Contents][Index]

5.2.1 Special variables

Special Variable: *sleep-amount*

Amount of time to sleep between checking query-io. In multiprocessing Lisps, this allows other processes to continue while we busy-wait. If 0, skips call to SLEEP.

Package

text-query

Source

text-query.lisp (file)

Special Variable: *timeout*
Package

text-query

Source

text-query.lisp (file)

Special Variable: *y-or-n-p-choices*
Package

text-query

Source

text-query.lisp (file)

Special Variable: *y-or-n-p-wait-default*
Package

text-query

Source

text-query.lisp (file)

Special Variable: *yes-or-no-p-choices*
Package

text-query

Source

text-query.lisp (file)

Special Variable: *yes-or-no-p-wait-default*
Package

text-query

Source

text-query.lisp (file)


Previous: , Up: Internal definitions   [Contents][Index]

5.2.2 Functions

Function: internal-real-time-in-seconds ()
Package

text-query

Source

text-query.lisp (file)

Function: query-internal &key FORMAT-STRING FORMAT-ARGUMENTS TYPE CHOICES BEEP CLEAR-INPUT FRESH-LINE LIST-CHOICES HELP-STRING TIMEOUT TIMEOUT-DEFAULT STREAM SIGNAL-CONDITION EOF-ERROR-P EOF-VALUE
Package

text-query

Source

text-query.lisp (file)

Function: read-char-wait &optional TIMEOUT INPUT-STREAM EOF-ERROR-P EOF-VALUE &aux PEEK
Package

text-query

Source

text-query.lisp (file)

Function: read-line-wait &optional TIMEOUT INPUT-STREAM EOF-ERROR-P EOF-VALUE &aux PEEK
Package

text-query

Source

text-query.lisp (file)


Previous: , Up: Top   [Contents][Index]

Appendix A Indexes


Next: , Previous: , Up: Indexes   [Contents][Index]

A.1 Concepts

Jump to:   D   F   L   T  
Index Entry  Section

D
Doc File, text-query/README: The text-query/readme file

F
File, doc, text-query/README: The text-query/readme file
File, Lisp, text-query.asd: The text-query<dot>asd file
File, Lisp, text-query/text-query.lisp: The text-query/text-query<dot>lisp file

L
Lisp File, text-query.asd: The text-query<dot>asd file
Lisp File, text-query/text-query.lisp: The text-query/text-query<dot>lisp file

T
text-query.asd: The text-query<dot>asd file
text-query/README: The text-query/readme file
text-query/text-query.lisp: The text-query/text-query<dot>lisp file

Jump to:   D   F   L   T  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.2 Functions

Jump to:   F   I   Q   R   Y  
Index Entry  Section

F
Function, internal-real-time-in-seconds: Internal functions
Function, query: Exported functions
Function, query-internal: Internal functions
Function, read-char-wait: Internal functions
Function, read-line-wait: Internal functions
Function, y-or-n-p: Exported functions
Function, y-or-n-p-wait: Exported functions
Function, yes-or-no-p: Exported functions
Function, yes-or-no-p-wait: Exported functions

I
internal-real-time-in-seconds: Internal functions

Q
query: Exported functions
query-internal: Internal functions

R
read-char-wait: Internal functions
read-line-wait: Internal functions

Y
y-or-n-p: Exported functions
y-or-n-p-wait: Exported functions
yes-or-no-p: Exported functions
yes-or-no-p-wait: Exported functions

Jump to:   F   I   Q   R   Y  

Next: , Previous: , Up: Indexes   [Contents][Index]

A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*sleep-amount*: Internal special variables
*timeout*: Internal special variables
*y-or-n-p-choices*: Internal special variables
*y-or-n-p-wait-default*: Internal special variables
*yes-or-no-p-choices*: Internal special variables
*yes-or-no-p-wait-default*: Internal special variables

S
Special Variable, *sleep-amount*: Internal special variables
Special Variable, *timeout*: Internal special variables
Special Variable, *y-or-n-p-choices*: Internal special variables
Special Variable, *y-or-n-p-wait-default*: Internal special variables
Special Variable, *yes-or-no-p-choices*: Internal special variables
Special Variable, *yes-or-no-p-wait-default*: Internal special variables

Jump to:   *  
S  

Previous: , Up: Indexes   [Contents][Index]

A.4 Data types

Jump to:   P   S   T  
Index Entry  Section

P
Package, text-query: The text-query package
Package, text-query-system: The text-query-system package

S
System, text-query: The text-query system

T
text-query: The text-query system
text-query: The text-query package
text-query-system: The text-query-system package

Jump to:   P   S   T