The query-repl Reference Manual

Table of Contents

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

The query-repl Reference Manual

This is the query-repl Reference Manual, version 4.0.12, generated automatically by Declt version 3.0 "Montgomery Scott" on Wed Oct 13 12:17:41 2021 GMT+0.


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

1 Introduction

QUERY-REPL 4.0.9

What is this?

REPL for user query.

Alternatives and differences.

| | duologue | text-query | query-repl | | --- | ---------- | ------------ | ---------- | | Coloring | * | | | | Default | * | | | | Completion | * | | | | Return some | * | | | | Validation | * | | | | Timeout | | * | | | REPL | | | * | | Pagenation | | | * |

Usage

For details, see spec file.

QUERY-CASE

The syntax is almost same with cl:restart-case except the first argument and :test keyword param. First argument should print query message. The return value of the first argument is discarded.

* (query-case (write-line "Choose one of below." *query-io*)
    (one () :report "One!" 1)
    (two () :report "Two!" 2)
    (input (input) :interactive (lambda () (format *query-io* "Input>> ")
                                  (force-output *query-io*)
                                  (list (read)))
      input))
Choose one of below.

  0: [ONE  ] One!
  1: [TWO  ] Two!
  2: [INPUT] Invoke restart INPUT.

;; You can do anything in REPL.
> (+ 1 2 3)

6

;; To choose restart, type integer or restart-name.
  0: [ONE] One!
  1: [TWO] Two!
  2: [INPUT] Invoke restart INPUT.
> 2
Input>> "hoge"
"hoge"
*

*QUERY-EVAL*

If you do not need the full power of REPL, you can bind *QUERY-EVAL* with NIL. In such cases, QUERY-REPL acts as echo REPL, and CL:*READ-EVAL* is bound by NIL automatically.

* (let (*query-eval*)
    (query-case (write-line "Works like echo." *query-io*)
      (one () :report "One" 1)))
Works like echo.

  0: [ONE] One
> (+ 1 2 3)

(+ 1 2 3)
  0: [ONE] One

;; Reader error is ignored.
> #.(+ 1 2 3)
WARNING:
   Ignore: can't read #. while *READ-EVAL* is NIL

             Stream: #<SYNONYM-STREAM :SYMBOL *TERMINAL-IO* {10000385B3}>

NIL
  0: [ONE] One
> )
WARNING:
   Ignore: unmatched close parenthesis

             Stream: #<SYNONYM-STREAM :SYMBOL *TERMINAL-IO* {10000385B3}>

NIL
  0: [ONE] One
> no-such-package:symbol
WARNING:
   Ignore: Package NO-SUCH-PACKAGE does not exist.

             Stream: #<SYNONYM-STREAM :SYMBOL *TERMINAL-IO* {10000385B3}>

NIL
  0: [ONE] One

;; Ctl-C is also ignored.
> WARNING: Ignore: Interactive interrupt at #x7F31187D3CF9.

NIL
  0: [ONE] One

;; Ctl-D is also ignored.
> WARNING:
   Ignore: end of file on #<SB-SYS:FD-STREAM for "the terminal" {1001578A53}>

NIL
  0: [ONE] One

> 0
1

SELECT

When selection is dynamic values, you can use SELECT.

* (select (list 1 'symbol #'car))

  0: [SELECT] 1
  1: [SELECT] SYMBOL
  2: [SELECT] #<FUNCTION CAR>
> 2
#<FUNCTION CAR>

PAGED-SELECT

If selection is big, PAGED-SELECT may helps you.

* (paged-select (loop :for i :below 20 :collect i))

  0: [SELECT] #:NEXT
  1: [SELECT] 0
  2: [SELECT] 1
  3: [SELECT] 2
  4: [SELECT] 3
  5: [SELECT] 4
  6: [SELECT] 5
  7: [SELECT] 6
  8: [SELECT] 7
  9: [SELECT] 8
> 0

  0: [SELECT] #:NEXT
  1: [SELECT] #:PREV
  2: [SELECT] 9
  3: [SELECT] 10
  4: [SELECT] 11
  5: [SELECT] 12
  6: [SELECT] 13
  7: [SELECT] 14
  8: [SELECT] 15
  9: [SELECT] 16
> 5
12
*

&KEY MAX

To specify max selection num, use the keyword parameter :MAX (the default is 10).

NOTE

The selection includes NEXT and/or PREV.

* (paged-select (loop :for i :below 20 :collect i)
                :max 5)

  0: [SELECT] #:NEXT
  1: [SELECT] 0
  2: [SELECT] 1
  3: [SELECT] 2
  4: [SELECT] 3
>

&KEY KEY

When keyword parameter :KEY is specified, such function is applied to each element of selection.

NOTE

The :KEY function is applied only to printed selection. If the user selects from the first page, the rest elements are never applied.

* (paged-select (loop :for i :below 20 :collect i)
                :key (lambda (x) (princ x) (force-output) (princ-to-string x)))
012345678               ; <--- The function applied only first page elements.
  0: [SELECT] #:NEXT
  1: [SELECT] "0"
  2: [SELECT] "1"
  3: [SELECT] "2"
  4: [SELECT] "3"
  5: [SELECT] "4"
  6: [SELECT] "5"
  7: [SELECT] "6"
  8: [SELECT] "7"
  9: [SELECT] "8"
> 0                     ; <--- Choose next page.
910111213141516         ; <--- The function applied only this page elements.
  0: [SELECT] #:NEXT
  1: [SELECT] #:PREV
  2: [SELECT] "9"
  3: [SELECT] "10"
  4: [SELECT] "11"
  5: [SELECT] "12"
  6: [SELECT] "13"
  7: [SELECT] "14"
  8: [SELECT] "15"
  9: [SELECT] "16"
> 1                     ; <--- Choose previous page.
                        ; <--- The function is not applied.
  0: [SELECT] #:NEXT
  1: [SELECT] "0"
  2: [SELECT] "1"
  3: [SELECT] "2"
  4: [SELECT] "3"
  5: [SELECT] "4"
  6: [SELECT] "5"
  7: [SELECT] "6"
  8: [SELECT] "7"
  9: [SELECT] "8"
> 0

  0: [SELECT] #:NEXT
  1: [SELECT] #:PREV
  2: [SELECT] "9"
  3: [SELECT] "10"
  4: [SELECT] "11"
  5: [SELECT] "12"
  6: [SELECT] "13"
  7: [SELECT] "14"
  8: [SELECT] "15"
  9: [SELECT] "16"
> 0
171819
  0: [SELECT] #:PREV
  1: [SELECT] "17"
  2: [SELECT] "18"
  3: [SELECT] "19"
> 1

"17"
*

From developer

Product's goal

?

License

MIT

Developed with

SBCL

Tested with

Installation

TODO


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 query-repl

Author

SATO Shinichi

Source Control

(:git "git@github.com:hyotang666/query-repl")

Bug Tracker

https://github.com/hyotang666/query-repl/issues

License

MIT

Description

REPL for user query.

Version

4.0.12

Dependencies
Source

query-repl.asd (file)

Component

query-repl.lisp (file)


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

3 Files

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


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

3.1 Lisp


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

3.1.1 query-repl.asd

Location

/home/quickref/quicklisp/dists/quicklisp/software/query-repl-20210807-git/query-repl.asd

Systems

query-repl (system)


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

3.1.2 query-repl/query-repl.lisp

Parent

query-repl (system)

Location

query-repl.lisp

Packages

query-repl

Exported Definitions
Internal Definitions

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

4 Packages

Packages are listed by definition order.


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

4.1 query-repl

Source

query-repl.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


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

5.1.1 Special variables

Special Variable: *prompt*

# \*PROMPT\*

## Description:

## Value type is T.

“‘lisp
#?
*PROMPT* :be-the “‘
Initial value is ‘">"‘

## Affected By: QUERY-PROMPT

## Notes:

Package

query-repl

Source

query-repl.lisp (file)

Special Variable: *query-eval*

# \*QUERY-EVAL\*

## Description:

## Value type is BOOLEAN

“‘lisp
#?
*QUERY-EVAL* :be-the “‘
Initial value is ‘T‘

## Affected By: QUERY-READ, QUERY-EVAL

## Notes:

Package

query-repl

Source

query-repl.lisp (file)


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

5.1.2 Macros

Macro: query-bind BINDS &body BODY

# QUERY-BIND

## Description:

### syntax (QUERY-BIND (&rest bind\*) &body body)
=> result

## Arguments and Values:
bind := (query-name function &key report-function interactive-function)
query-name := symbol, otherwise an implementation dependent condition.

“‘lisp
#?(query-bind (("not symbol" (lambda () :dummy))))
:signals condition
“‘
Not evaluated.

“‘lisp
#?(query-bind (((intern "Not evaluated") (lambda () :dummy))))
:signals condition
“‘
function := function, otherwise an implementation dependent condition.

“‘lisp
#?(query-bind ((name "not function")))
:signals condition
“‘

“‘lisp
#?(query-bind ((name ’no-such-function)))
:signals condition
“‘
Evaluated.

“‘lisp
#?(query-bind ((name (coerce ’list ’function))))
:invokes-debugger not
“‘
If the argument FUNCTION does not transfer control flow, EXP is returned.

“‘lisp
#?(query-bind ((name #’list))
(query-eval 0))
=> 0
“‘
report-function := function, otherwise an implementation dependent conditioin.

“‘lisp
#?(query-bind ((name #’list :report-function "not function")))
:signals condition
“‘
Evaluated.

“‘lisp
#?(query-bind ((name #’list :report-function (coerce #’print ’function)))) :invokes-debugger not
“‘
If specified such function should have API as (function (stream)).
Specified function is called to print selection report.

“‘lisp
#?(query-bind ((name (lambda () :dummy)
:report-function (lambda (s) (format s "Report"))))
(query-prompt))
:outputs "
0: [NAME] Report
> "
, :stream
“‘
When NIL (the default), selection name is printed as report.

“‘lisp
#?(query-bind ((name (lambda () :dummy)))
(query-prompt))
:outputs "
0: [NAME] NAME
> "
, :stream
“‘
interactive-function := function, otherwise an implementation dependent condition.

“‘lisp
#?(with-input-from-string (in "name")
(let ((*query-io* (make-two-way-stream in (make-broadcast-stream))))
(query-bind ((name (lambda () :dummy) :interactive-function "not function")) (query-repl))))
:signals condition
“‘
If specifed, such function should have API as (function () list).
Specifed function is called when selection is selected.

“‘lisp
#?(query-bind ((name (lambda (a) a)
:interactive-function (lambda () (list (princ :hoge)))))
(query-eval 0))
:outputs "HOGE"
“‘
If specified, such functions return value is APPLYed the first argument FUNCTION.

“‘lisp
#?(query-bind ((name #’princ :interactive-function (lambda () (list :a *standard-output*)))) (query-eval 0))
:outputs "A"
“‘
body := implicit PROGN
result := T.

## Affected By:
QUERY-REPL::*SELECTIONS*

## Side-Effects:
Modify environment i.e. QUERY-REPL::*SELECTIONS*.

## Notes:

## Exceptional-Situations:

Package

query-repl

Source

query-repl.lisp (file)

Macro: query-case QUERY &body CLAUSES

# QUERY-CASE

## Description:

### syntax (QUERY-CASE query &body clauses)
=> result

## Arguments and Values:
query := Form which print query message.
clause := (name lambda-list query-param* &body body)
name := symbol, otherwise error.

“‘lisp
#?(query-case () ("not symbol" ()))
:signals error
“‘
Not evaluated.

“‘lisp
#?(query-case () ((intern "Not evaluated")))
:signals error
“‘
lambda-list := ordinary lambda list.

“‘lisp
#?(query-case () (name "not list"))
:signals error
“‘
query-param := [ :report report-form | :interactive function-name ]
report-form := [ function-name | string ]
When report-form function-name is specified, such function should have API as (function (stream)).

“‘lisp
#?(query-case () (name () :report (formatter "not function name")))
:signals error
“‘
When string is specified, treated as (lambda (s) (format s string)).

“‘lisp
#?(with-input-from-string (in "0")
(let ((*query-io* (make-two-way-stream in *query-io*)))
(query-case () (name () :report "Printed."))))
:outputs "
0: [NAME] Printed.
> "
, :stream
“‘
function-name := [ symbol | (cons (eql lambda)) ]
When interactive function is specified, such function should have API as (function () list). Returned values are applied to LAMBDA-LIST and BODY is evaluated.

“‘lisp
#?(with-input-from-string (in "0")
(let ((*query-io* (make-two-way-stream in *query-io*)))
(query-case ()
(name (a) :interactive (lambda () (list :returned))
a))))
=> :RETURNED
, :stream
“‘
body := implicit progn.
result := T

## Affected By:
QUERY-REPL::*SELECTIONS* internally.

“‘lisp
#?(with-input-from-string (in "test")
(let ((*query-io* (make-two-way-stream in *query-io*)))
(block :block
(query-bind ((test (lambda () (return-from :block :return))))
(query-case ()
(a () :a))))))
:outputs "
0: [A ] A
1: [TEST] TEST
> "
, :stream
“‘

“‘lisp
#?(with-input-from-string (in "test")
(let ((*query-io* (make-two-way-stream in *query-io*)))
(block :block
(query-bind ((test (lambda () (return-from :block :return))))
(query-case ()
(a () :a))))))
=> :RETURN
, :stream
“‘

## Side-Effects:

## Notes:

## Exceptional-Situations:

Package

query-repl

Source

query-repl.lisp (file)


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

5.1.3 Functions

Function: paged-select LIST &key MAX KEY

# PAGED-SELECT

## Description:

### syntax (PAGED-SELECT list &key (max 10) (key #’identity))
=> result

## Arguments and Values:
list := list, otherwise an implementation dependent condition.

“‘lisp
#?(paged-select "not list")
:signals condition
“‘
max := (integer 3 *), otherwise an implementation dependent condition.

“‘lisp
#?(paged-select ’(1 2 3) :max 1)
:signals condition
“‘

“‘lisp
#?(paged-select ’(1 2 3) :max -1)
:signals condition
“‘

“‘lisp
#?(paged-select ’(1 2 3) :max 10.0)
:signals condition
“‘

“‘lisp
#?(paged-select ’(1 2 3) :max "not integer")
:signals condition
“‘
When specified, output selection has specified size.

“‘lisp
#?(with-input-from-string (in "1")
(let ((*query-io* (make-two-way-stream in *query-io*))) (paged-select (loop :for i :below 10 :collect i) :max 3))) :outputs "
0: [SELECT] #:NEXT
1: [SELECT] 0
2: [SELECT] 1
> "
, :stream
“‘
key := function designator, otherwise an implementation dependent condition.

“‘lisp
#?(paged-select ’(1 2 3) :key "not function")
:signals condition
“‘
If specified, each element is applied.

“‘lisp
#?(with-input-from-string (in "1")
(let ((*query-io* (make-two-way-stream in *query-io*))) (paged-select ’(1 2 3) :key #’princ-to-string)))
=> "2"
, :test
“‘
result := T

## Affected By:
Dynamic environment of QUERY-REPL::*SELECTIONS*

“‘lisp
#?(with-input-from-string (in "3")
(let ((*query-io* (make-two-way-stream in *query-io*)))
(block :block
(query-bind ((test (lambda () (return-from :block :returned)))) (paged-select ’(1 2 3))))))
=> :RETURNED
, :stream
“‘
*QUERY-EVAL*

“‘lisp
#?(with-input-from-string (in "(print :hoge) 0")
(let ((*query-io* (make-two-way-stream in (make-broadcast-stream)))) (paged-select ’(1 2 3))))
:outputs "
:HOGE "
“‘

## Side-Effects:

## Notes:
Key function is applied only printed page elements.

“‘lisp
#?(with-input-from-string (in "1")
(let ((*query-io* (make-two-way-stream in (make-broadcast-stream)))) (paged-select (loop :for i :below 20 :collect i)
:key (lambda (x) (princ x) (force-output) x)))) :outputs "012345678"
“‘
Additionaly such function is applied only once.

“‘lisp
#?(with-input-from-string (in (concatenate ’string
"0" ; <— Choose #:NEXT.
" 1" ; <— Choose #:PREV.
" 2")) ; <— Select.
(let ((*query-io* (make-two-way-stream in (make-broadcast-stream)))) (paged-select (loop :for i :below 20 :collect i)
:key (lambda (x) (princ x) (force-output) x)))) :outputs "012345678910111213141516"
“‘

## Exceptional-Situations:

Package

query-repl

Source

query-repl.lisp (file)

Function: query-eval EXP

# QUERY-EVAL

## Description:

### syntax (QUERY-EVAL exp)
=> result

## Arguments and Values:
exp := T
result := T

## Affected By:
*QUERY-EVAL*
When *QUERY-EVAL* is NIL, EXP itself is returned.

“‘lisp
#?(query-eval ’(+))
=> 0
“‘

“‘lisp
#?(let ((*query-eval*))
(query-eval ’(+)))
=> (+)
, :test
“‘
QUERY-REPL::*SELECTIONS* internal use.
When EXP is integer and can get (nth EXP QUERY-REPL::*SELECTIONS*)
such selections interactive-function is called.

“‘lisp
#?(query-bind ((test (lambda () (princ :will-printed))))
(query-eval 0))
:outputs "WILL-PRINTED"
“‘
When EXP is symbol and can get only one slection from QUERY-REPL::*SELECTION* by its name such selections interactive-function is called.

“‘lisp
#?(query-bind ((test (lambda () (princ :will-printed))))
(query-eval :test))
:outputs "WILL-PRINTED"
“‘
When EXP is symbol and some selections are selected from QUERY-REPL::*SELECTION* by name a warning is signaled.

“‘lisp
#?(query-bind ((test (lambda () (princ :never)))
(test2 (lambda () (princ :never))))
(query-eval :test))
:signals warning
“‘
In such case, (values) are returned.

“‘lisp
#?(query-bind ((test (lambda () (princ :never)))
(test2 (lambda () (princ :never))))
(query-eval :test))
:values ()
, :ignore-signals
“‘

## Side-Effects:
Refer *QUERY-EVAL*
Modify +++ ++ + /// // / *** ** *.

## Notes:

## Exceptional-Situations:

Package

query-repl

Source

query-repl.lisp (file)

Function: query-prompt &optional *STANDARD-OUTPUT*

# QUERY-PROMPT

## Description:

### syntax (QUERY-PROMPT &optional (\*standard-output\* \*query-io\*)) => result

## Arguments and Values:
*standard-output* := Output stream, otherwise error.

“‘lisp
#?(query-prompt "not-stream")
:signals error
“‘
result := NULL

“‘lisp
#?(query-prompt)
=> NIL
, :stream
“‘

## Affected By:
*PROMPT*

“‘lisp
#?(let ((*prompt* "input>"))
(query-prompt))
:outputs "
input> "
, :stream
“‘

## Side-Effects:
Outputs to ‘STREAM‘.

## Notes:

## Exceptional-Situations:

Package

query-repl

Source

query-repl.lisp (file)

Function: query-read &optional *STANDARD-INPUT*

# QUERY-READ

## Description:
Thin wrapper for CL:READ.

### syntax (QUERY-READ &optional (\*standard-input\* \*query-io\*))
=> result

## Arguments and Values:
*standard-input* := input stream, otherwise error.

“‘lisp
#?(query-read "not stream")
:signals type-error
“‘
result := Lisp form.

## Affected By:
*QUERY-EVAL* *READ-EVAL* *READ-BASE* *READ-DEFAULT-FLOAT-FORMAT* *READ-SUPPRESS* When *QUERY-EVAL* is NIL, *READ-EVAL* is set NIL automatically.

“‘lisp
#?(let ((*query-eval*))
(with-input-from-string (*query-io* "#.(+)")
(query-read)))
:signals reader-error
“‘

## Side-Effects:
Consume stream contents.

## Notes:

## Exceptional-Situations:

Package

query-repl

Source

query-repl.lisp (file)

Function: query-repl ()

# QUERY-REPL

## Description:

### syntax (QUERY-REPL)
=> result

## Arguments and Values:
result := T

## Affected By:
QUERY-REPL::*SELECTIONS*

“‘lisp
#?(block :block
(query-bind ((nil (lambda () (return-from :block 0)))) (with-input-from-string (s "0")
(let ((*query-io* (make-two-way-stream s *query-io*))) (query-repl)))))
=> 0
, :stream
“‘
*QUERY-EVAL*
When *QUERY-EVAL* is NIL, and meed #. dispatch macro
warning is signaled.

“‘lisp
#?(let (*query-eval*)
(block :block
(query-bind ((nil (lambda () (return-from :block 0)))) (with-input-from-string (s "#.1")
(let ((*query-io* (make-two-way-stream s *query-io*))) (query-repl))))))
:signals warning
“‘
In such case, do next loop.

“‘lisp
#?(let (*query-eval*)
(block :block
(query-bind ((nil (lambda () (return-from :block 0)))) (with-input-from-string (s "#.1 0")
(let ((*query-io* (make-two-way-stream s *query-io*))) (query-repl))))))
=> 0
, :stream
“‘
*READ-EVAL* *READ-BASE* *READ-DEFAULT-FLOAT-FORMAT* *READ-SUPPRESS*

## Side-Effects:
io *QUERY-IO*.

## Notes:

## Exceptional-Situations:

Package

query-repl

Source

query-repl.lisp (file)

Function: select LIST

# SELECT

## Description:

### syntax (SELECT list)
=> result

## Arguments and Values:
list := list, otherwise error.

“‘lisp
#?(select :atom)
:signals type-error
“‘
result := selected elt of the list.

“‘lisp
#?(with-input-from-string (in "0") ; <— select 0 th.
(let ((*query-io* (make-two-way-stream in *query-io*)))
(select ’(1 2 3))))
=> 1
, :stream
“‘

“‘lisp
#?(with-input-from-string (in "1") ; <— select 1 th.
(let ((*query-io* (make-two-way-stream in *query-io*)))
(select ’(1 2 3))))
=> 2
, :stream
“‘

## Affected By:
Dynamic environment of QUERY-REPL::*SELECTIONS*

“‘lisp
#?(with-input-from-string (in "1")
(let ((*query-io* (make-two-way-stream in *query-io*)))
(block :block
(query-bind ((test (lambda () (return-from :block :selected)))) (select ’(:never))))))
=> :SELECTED
, :stream
“‘

## Side-Effects:
Input / Output *query-io*

“‘lisp
#?(with-input-from-string (in "1")
(let ((*query-io* (make-two-way-stream in *query-io*)))
(block :block
(query-bind ((test (lambda () (return-from :block :selected)))) (select ’(:never))))))
:outputs "
0: [SELECT] :NEVER
1: [TEST ] TEST
> "
, :stream
“‘

## Notes:

## Exceptional-Situations:

Package

query-repl

Source

query-repl.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: *selections*
Package

query-repl

Source

query-repl.lisp (file)


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

5.2.2 Functions

Function: <make-selection-form> CLAUSE BLOCK

# <MAKE-SELECTION-FORM>

## Description:

### syntax (<MAKE-SELECTION-FORM> clause block)
=> result

## Arguments and Values:
clause :=
block :=
result :=

## Affected By:

## Side-Effects:

## Notes:

## Exceptional-Situations:

## Tests.

“‘lisp
#?(<make-selection-form> ’(name ()) :block)
=> (NAME (LAMBDA () (RETURN-FROM :BLOCK (PROGN)))
:REPORT-FUNCTION (LAMBDA (query-repl::S) (FORMAT query-repl::S "~A" ’NAME)) :INTERACTIVE-FUNCTION NIL)
“‘

“‘lisp
#?(<make-selection-form> ’(name () :report fun-name-as-symbol) :block)
=> (NAME (LAMBDA () (RETURN-FROM :BLOCK (PROGN)))
:REPORT-FUNCTION #’FUN-NAME-AS-SYMBOL
:INTERACTIVE-FUNCTION NIL)
“‘

“‘lisp
#?(<make-selection-form> ’(name () :report (lambda (s) (format s "hoge"))) :block) => (NAME (LAMBDA () (RETURN-FROM :BLOCK (PROGN)))
:REPORT-FUNCTION #’(LAMBDA (S) (FORMAT S "hoge"))
:INTERACTIVE-FUNCTION NIL)
“‘

“‘lisp
#?(<make-selection-form> ’(name () :report "hoge") :block)
=> (NAME (LAMBDA () (RETURN-FROM :BLOCK (PROGN)))
:REPORT-FUNCTION (LAMBDA (query-repl::S) (FORMAT query-repl::S "hoge")) :INTERACTIVE-FUNCTION NIL)
“‘

“‘lisp
#?(<make-selection-form> ’(name () :interactive (lambda () (list 0))) :block)
=> (NAME (LAMBDA () (RETURN-FROM :BLOCK (PROGN)))
:REPORT-FUNCTION (LAMBDA (QUERY-REPL::S) (FORMAT QUERY-REPL::S "~A" ’NAME)) :INTERACTIVE-FUNCTION #’(LAMBDA () (LIST 0)))
“‘

“‘lisp
#?(<make-selection-form> ’(name () :interactive) :block)
=> (NAME (LAMBDA () (RETURN-FROM :BLOCK (PROGN :INTERACTIVE)))
:REPORT-FUNCTION (LAMBDA (QUERY-REPL::S) (FORMAT QUERY-REPL::S "~A" ’NAME)) :INTERACTIVE-FUNCTION NIL)
“‘

Package

query-repl

Source

query-repl.lisp (file)

Function: copy-selection INSTANCE
Package

query-repl

Source

query-repl.lisp (file)

Function: make-selection &key (NAME NAME) (REPORT-FUNCTION REPORT-FUNCTION) (INTERACTIVE-FUNCTION INTERACTIVE-FUNCTION)
Package

query-repl

Source

query-repl.lisp (file)

Function: parse-query-clause CLAUSE
Package

query-repl

Source

query-repl.lisp (file)

Function: pprint-query-case STREAM EXP
Package

query-repl

Source

query-repl.lisp (file)

Function: pprint-query-case-clause STREAM EXP &rest NOISE
Package

query-repl

Source

query-repl.lisp (file)

Function: selection-interactive-function INSTANCE
Package

query-repl

Source

query-repl.lisp (file)

Function: selection-name INSTANCE
Package

query-repl

Source

query-repl.lisp (file)

Function: selection-p OBJECT
Package

query-repl

Source

query-repl.lisp (file)

Function: selection-report-function INSTANCE
Package

query-repl

Source

query-repl.lisp (file)


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

5.2.3 Structures

Structure: selection ()
Package

query-repl

Source

query-repl.lisp (file)

Direct superclasses

structure-object (structure)

Direct slots
Slot: name
Type

symbol

Readers

selection-name (function)

Writers

(setf selection-name) (function)

Slot: report-function
Type

function

Initform

(error "required")

Readers

selection-report-function (function)

Writers

(setf selection-report-function) (function)

Slot: interactive-function
Type

function

Initform

(error "required")

Readers

selection-interactive-function (function)

Writers

(setf selection-interactive-function) (function)


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

Appendix A Indexes


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

A.1 Concepts

Jump to:   F   L   Q  
Index Entry  Section

F
File, Lisp, query-repl.asd: The query-repl․asd file
File, Lisp, query-repl/query-repl.lisp: The query-repl/query-repl․lisp file

L
Lisp File, query-repl.asd: The query-repl․asd file
Lisp File, query-repl/query-repl.lisp: The query-repl/query-repl․lisp file

Q
query-repl.asd: The query-repl․asd file
query-repl/query-repl.lisp: The query-repl/query-repl․lisp file

Jump to:   F   L   Q  

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

A.2 Functions

Jump to:   <  
C   F   M   P   Q   S  
Index Entry  Section

<
<make-selection-form>: Internal functions

C
copy-selection: Internal functions

F
Function, <make-selection-form>: Internal functions
Function, copy-selection: Internal functions
Function, make-selection: Internal functions
Function, paged-select: Exported functions
Function, parse-query-clause: Internal functions
Function, pprint-query-case: Internal functions
Function, pprint-query-case-clause: Internal functions
Function, query-eval: Exported functions
Function, query-prompt: Exported functions
Function, query-read: Exported functions
Function, query-repl: Exported functions
Function, select: Exported functions
Function, selection-interactive-function: Internal functions
Function, selection-name: Internal functions
Function, selection-p: Internal functions
Function, selection-report-function: Internal functions

M
Macro, query-bind: Exported macros
Macro, query-case: Exported macros
make-selection: Internal functions

P
paged-select: Exported functions
parse-query-clause: Internal functions
pprint-query-case: Internal functions
pprint-query-case-clause: Internal functions

Q
query-bind: Exported macros
query-case: Exported macros
query-eval: Exported functions
query-prompt: Exported functions
query-read: Exported functions
query-repl: Exported functions

S
select: Exported functions
selection-interactive-function: Internal functions
selection-name: Internal functions
selection-p: Internal functions
selection-report-function: Internal functions

Jump to:   <  
C   F   M   P   Q   S  

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

A.3 Variables

Jump to:   *  
I   N   R   S  
Index Entry  Section

*
*prompt*: Exported special variables
*query-eval*: Exported special variables
*selections*: Internal special variables

I
interactive-function: Internal structures

N
name: Internal structures

R
report-function: Internal structures

S
Slot, interactive-function: Internal structures
Slot, name: Internal structures
Slot, report-function: Internal structures
Special Variable, *prompt*: Exported special variables
Special Variable, *query-eval*: Exported special variables
Special Variable, *selections*: Internal special variables

Jump to:   *  
I   N   R   S  

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

A.4 Data types

Jump to:   P   Q   S  
Index Entry  Section

P
Package, query-repl: The query-repl package

Q
query-repl: The query-repl system
query-repl: The query-repl package

S
selection: Internal structures
Structure, selection: Internal structures
System, query-repl: The query-repl system

Jump to:   P   Q   S