The quicksearch Reference Manual

This is the quicksearch Reference Manual, version 0.1.3, generated automatically by Declt version 4.0 beta 2 "William Riker" on Wed May 15 06:40:01 2024 GMT+0.

Table of Contents


1 Introduction


2 Systems

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


2.1 quicksearch

Quicksearch searches CL library, and outputs results at REPL.

Author

Takaya OCHIAI <>

License

MIT License

Version

0.1.3

Dependencies
  • iterate (system).
  • anaphora (system).
  • alexandria (system).
  • cl-ppcre (system).
  • drakma (system).
  • yason (system).
  • flexi-streams (system).
  • do-urlencode (system).
  • html-entities (system).
  • bordeaux-threads (system).
Source

quicksearch.asd.

Child Component

quicksearch.lisp (file).


3 Files

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


3.1 Lisp


3.1.1 quicksearch/quicksearch.asd

Source

quicksearch.asd.

Parent Component

quicksearch (system).

ASDF Systems

quicksearch.


3.1.2 quicksearch/quicksearch.lisp

Source

quicksearch.asd.

Parent Component

quicksearch (system).

Packages

quicksearch.

Public Interface
Internals

4 Packages

Packages are listed by definition order.


4.1 quicksearch

Source

quicksearch.lisp.

Nickname

qs

Use List
  • common-lisp.
  • iterate.
Public Interface
Internals

5 Definitions

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


5.1 Public Interface


5.1.1 Special variables

Special Variable: *user-agent*

This value tells the server who is requested (i.e. User-Agent header value). If you are embedding Quicksearch in a larger application, you should change the value of *USER-AGENT* to your application name and URL.

Package

quicksearch.

Source

quicksearch.lisp.


5.1.2 Ordinary functions

Function: ? (search-word &rest options)

? is abbreviation wrapper for function QUICKSEARCH.
‘search-word’ must be a string, number or symbol. ‘options’ must be a non-negative integer (as Cut-Off) and/or some keywords which consists of some Option-Chars.

Options:
* Cut-Off:
* The max number of printing results (default is 50).
* Option-Chars:
* d, D – output Description
* u, U – output URL
* q, Q – search in Quicklisp
* c, C – search in Cliki
* g, G – search in GitHub
* b, B – search in Bitbucket

Note:
* Option-Char is idempotent (e.g. :dd <=> :d).
* If ‘options’ contains more than 2 Cut-Offs, only last one is applyed.
* The order of Option-Chars is nothing to do with output
(e.g. :du <=> :ud).
* The order of ‘options’ is nothing to do with output
(except for some Cut-Offs).
* If no search-space is specified, all spaces are specified
(e.g. :d <=> :dqcgb).
* If at most one search-space is specified, then others are not specified.

Examples:
(? "crypt")
<=>
(quicksearch "crypt" :?description nil :?url nil :?cut-off 50 :?quicklisp t :?cliki t :?github t :?bitbucket t)

(? "crypt" :du 10)
<=>
(quicksearch "crypt" :?description T :?url T :?cut-off 10
:?quicklisp t :?cliki t :?github t :?bitbucket t)

(? "crypt" 20 :g :d)
<=>
(quicksearch "crypt" :?description T :?url nil :?cut-off 20
:?quicklisp nil :?cliki nil :?github T :?bitbucket nil)

Package

quicksearch.

Source

quicksearch.lisp.

Function: config (&key maximum-columns-of-description maximum-number-of-fetching-repositories cache-size clear-cache? threading? quicklisp-verbose?)

Function CONFIG customizes printing, fetching or caching.
If CONFIG is called with no keyword, then it sets default values.

Keywords:

* ‘:maximum-columns-of-description’ (default 80)
The value must be a plus integer bigger than 5.
If the length of description-string is bigger than this value,
then output of description is inserted newline for easy to see.

* ‘:maximum-number-of-fetching-repositories’ (default 50)
This value controls the number of fetching repositories.
The value must be a plus integer.
Increasing this value, the number of fetching repositories increases,
but also space & time does.

* ‘:cache-size’
The value must be a plus integer (default 4).
This value is the number of stored previous search-results.
Increasing this value, the number of caching results increases, but
also space does.

* ‘:clear-cache?’
The value must be a boolean (default NIL).
If value is T, then clear all caches.

* ‘:threading?’
The value must be a boolean (default T).
If value is NIL, then QUICKSEARCH becomes not to use threads for
searching.

Note:
Currently on SBCL (1.1.8), threads are part of the default build on
x86[-64] Linux only. Other platforms (x86[-64] Darwin (Mac OS X),
x86[-64] FreeBSD, x86 SunOS (Solaris), and PPC Linux)
experimentally supports threads and must be explicitly enabled at
build-time. For more details, please see [SBCL manual](http://www.sbcl.org/manual/index.html#Threading).

* ‘:quicklisp-verbose?’
The value must be a boolean (default NIL).
If value is T, then outputs version of quicklisp and whether library
had installed your local.

Example:
CL-REPL> (qs:config :QUICKLISP-VERBOSE? t)
CL-REPL> (qs:? "json" :q)

SEARCH-RESULTS: "json"

Quicklisp: 2013-04-20 ;<- quicklisp version
!cl-json ;<- if library has been installed via quicklisp, print prefix "!". !cl-json.test
com.gigamonkeys.json ;<- if not, none.
json-template
st-json
T

Note:
* If you would prefer permanent configuration,
for example, add codes something like the following in the CL init
file.

In ‘.sbclrc‘ for SBCL, ‘ccl-init.lisp‘ for CCL:

(ql:quickload :quicksearch)
(qs:config :maximum-columns-of-description 50
:maximum-number-of-fetching-repositories 20
:cache-size 10
:threading? nil
:quicklisp-verbose? t)

Package

quicksearch.

Source

quicksearch.lisp.

Function: quicksearch (search-word &key ?web ?description ?url ?cut-off ?quicklisp ?cliki ?github ?bitbucket)

Search for CL projects with ‘search-word’ in Quicklisp, Cliki, GitHub and BitBucket. ‘search-word’ must be a string, number or symbol (symbol will be automatically converted into downcase-string).

Keywords:
* If ‘?web’ is NIL, it does not search in Cliki, GitHub and BitBucket. * If ‘?quicklisp’ is NIL, it does not search in Quicklisp (also ‘?cliki’, ‘?github’, ‘?bitbucket’).
* At least one search-space must be specified.
* If ‘?description’ is T, it displays project’s descriptions (except for Quicklisp-search).
* If ‘?url’ is T, it display project’s url.
* ‘?cut-off’ is the max number of printing repositories each space.

Note:
* keyword ‘?cut-off’ controls only printing results, nothing to do with the maximum number of fetching repositories (see. function CONFIG documentation).

* About #\Space in ‘search-word’:
In case ‘search-word’ contains #\Space, Quicklisp-search is OR-search, whereas Cliki-search, GitHub-, BitBucket- is AND-search. e.g. (quicksearch "foo bar")
Quicklisp-search for "foo" OR "bar",
Cliki-search, GitHub-, BitBucket- for "foo" AND "bar".

Package

quicksearch.

Source

quicksearch.lisp.


5.2 Internals


5.2.1 Special variables

Special Variable: *cache-size*
Package

quicksearch.

Source

quicksearch.lisp.

Special Variable: *cut-off*
Package

quicksearch.

Source

quicksearch.lisp.

Special Variable: *description-indent-num*
Package

quicksearch.

Source

quicksearch.lisp.

Special Variable: *description-print?*
Package

quicksearch.

Source

quicksearch.lisp.

Special Variable: *installed-prefix*
Package

quicksearch.

Source

quicksearch.lisp.

Special Variable: *max-num-description-columns*
Package

quicksearch.

Source

quicksearch.lisp.

Special Variable: *max-num-web-search-results*
Package

quicksearch.

Source

quicksearch.lisp.

Special Variable: *num-results-per-page*
Package

quicksearch.

Source

quicksearch.lisp.

Special Variable: *print-search-results?*
Package

quicksearch.

Source

quicksearch.lisp.

Special Variable: *quicklisp-verbose?*
Package

quicksearch.

Source

quicksearch.lisp.

Special Variable: *quicksearch-version*
Package

quicksearch.

Source

quicksearch.lisp.

Special Variable: *quicksearch-webpage*
Package

quicksearch.

Source

quicksearch.lisp.

Special Variable: *threading?*
Package

quicksearch.

Source

quicksearch.lisp.

Special Variable: *url-print?*
Package

quicksearch.

Source

quicksearch.lisp.


5.2.2 Ordinary functions

Function: clear-cache ()
Package

quicksearch.

Source

quicksearch.lisp.

Function: extract-bitbucket-next-page-url (response)
Package

quicksearch.

Source

quicksearch.lisp.

Function: extract-bitbucket-repos (response)
Package

quicksearch.

Source

quicksearch.lisp.

Function: extract-cliki-next-page-url (response)
Package

quicksearch.

Source

quicksearch.lisp.

Function: extract-cliki-repos (response)
Package

quicksearch.

Source

quicksearch.lisp.

Function: extract-github-next-page-url (response)
Package

quicksearch.

Source

quicksearch.lisp.

Function: extract-github-repos (response)
Package

quicksearch.

Source

quicksearch.lisp.

Function: extract-next-page-url (response space)
Package

quicksearch.

Source

quicksearch.lisp.

Function: extract-repos (response space)
Package

quicksearch.

Source

quicksearch.lisp.

Function: fetch (query space)
Package

quicksearch.

Source

quicksearch.lisp.

Function: gen-query (word space)
Package

quicksearch.

Source

quicksearch.lisp.

Function: gen-url (url space)
Package

quicksearch.

Source

quicksearch.lisp.

Function: get-quickdocs-url (sys)
Package

quicksearch.

Source

quicksearch.lisp.

Function: get-title (sys)
Package

quicksearch.

Source

quicksearch.lisp.

Function: get-url (sys)
Package

quicksearch.

Source

quicksearch.lisp.

Function: in-cache-p (word space)
Package

quicksearch.

Source

quicksearch.lisp.

Function: installed-p (sys)
Package

quicksearch.

Source

quicksearch.lisp.

Function: make-cache ()
Package

quicksearch.

Source

quicksearch.lisp.

Function: map-reduce (reducer mapper sequence)

MAP-REDUCE is suitable for only the case that ‘mapper”s cost is much expensive (e.g. QUICKSEARCH invokes DRAKMA:HTTP-REQUEST as ‘mapper’). For each element in ‘sequence’ (as an argument), ‘mapper’ is computed it with each thread, then the results are collected by ‘reducer’.

Examples: (inefficient but intuitive)

(map-reduce #’+
(lambda (x) (expt x 2)) ;<- each thread computes this ’(1 2 3 4))
=> 30

(map-reduce #’append
(lambda (x) (list (expt x 2)))
’(1 2 3 4))
=> (1 4 9 16)

(map-reduce (lambda (x y) (format nil "~A~A" x y))
(lambda (c) (code-char (1- (char-code c)))) "IBM")
=> "HAL"

Note:
* Use only for expensive computation (e.g. fetching a resource on the web).
* If ‘mapper’ assigns a value for the same global variable, it will cause interleave.
* Strictly, this MAP-REDUCE is not the MapReduce, but abstract model is the same if threads are equated with worker nodes.

Package

quicksearch.

Source

quicksearch.lisp.

Function: max-num-next-pages ()
Package

quicksearch.

Source

quicksearch.lisp.

Function: once-only-print-search-results (word)
Package

quicksearch.

Source

quicksearch.lisp.

Function: pprint-description (desc)
Package

quicksearch.

Source

quicksearch.lisp.

Function: print-line (n char)
Package

quicksearch.

Source

quicksearch.lisp.

Function: print-results (repos space)
Package

quicksearch.

Source

quicksearch.lisp.

Function: print-search-results (word)
Package

quicksearch.

Source

quicksearch.lisp.

Function: print-space (space)
Package

quicksearch.

Source

quicksearch.lisp.

Function: remove-tags (string)
Package

quicksearch.

Source

quicksearch.lisp.

Function: response-string (response)
Package

quicksearch.

Source

quicksearch.lisp.

Function: search-cache (word space)
Package

quicksearch.

Source

quicksearch.lisp.

Function: search-quicklisp (word)
Package

quicksearch.

Source

quicksearch.lisp.

Function: search-web (word space)
Package

quicksearch.

Source

quicksearch.lisp.

Function: search-web-by-thread (word space)
Package

quicksearch.

Source

quicksearch.lisp.

Function: set-version (sys)
Package

quicksearch.

Source

quicksearch.lisp.

Function: store-cache (word repos space)
Package

quicksearch.

Source

quicksearch.lisp.

Function: str (&rest strings)

Concatenates strings

Package

quicksearch.

Source

quicksearch.lisp.

Function: strip (string)
Package

quicksearch.

Source

quicksearch.lisp.


Appendix A Indexes


A.1 Concepts


A.2 Functions

Jump to:   ?  
C   E   F   G   I   M   O   P   Q   R   S  
Index Entry  Section

?
?: Public ordinary functions

C
clear-cache: Private ordinary functions
config: Public ordinary functions

E
extract-bitbucket-next-page-url: Private ordinary functions
extract-bitbucket-repos: Private ordinary functions
extract-cliki-next-page-url: Private ordinary functions
extract-cliki-repos: Private ordinary functions
extract-github-next-page-url: Private ordinary functions
extract-github-repos: Private ordinary functions
extract-next-page-url: Private ordinary functions
extract-repos: Private ordinary functions

F
fetch: Private ordinary functions
Function, ?: Public ordinary functions
Function, clear-cache: Private ordinary functions
Function, config: Public ordinary functions
Function, extract-bitbucket-next-page-url: Private ordinary functions
Function, extract-bitbucket-repos: Private ordinary functions
Function, extract-cliki-next-page-url: Private ordinary functions
Function, extract-cliki-repos: Private ordinary functions
Function, extract-github-next-page-url: Private ordinary functions
Function, extract-github-repos: Private ordinary functions
Function, extract-next-page-url: Private ordinary functions
Function, extract-repos: Private ordinary functions
Function, fetch: Private ordinary functions
Function, gen-query: Private ordinary functions
Function, gen-url: Private ordinary functions
Function, get-quickdocs-url: Private ordinary functions
Function, get-title: Private ordinary functions
Function, get-url: Private ordinary functions
Function, in-cache-p: Private ordinary functions
Function, installed-p: Private ordinary functions
Function, make-cache: Private ordinary functions
Function, map-reduce: Private ordinary functions
Function, max-num-next-pages: Private ordinary functions
Function, once-only-print-search-results: Private ordinary functions
Function, pprint-description: Private ordinary functions
Function, print-line: Private ordinary functions
Function, print-results: Private ordinary functions
Function, print-search-results: Private ordinary functions
Function, print-space: Private ordinary functions
Function, quicksearch: Public ordinary functions
Function, remove-tags: Private ordinary functions
Function, response-string: Private ordinary functions
Function, search-cache: Private ordinary functions
Function, search-quicklisp: Private ordinary functions
Function, search-web: Private ordinary functions
Function, search-web-by-thread: Private ordinary functions
Function, set-version: Private ordinary functions
Function, store-cache: Private ordinary functions
Function, str: Private ordinary functions
Function, strip: Private ordinary functions

G
gen-query: Private ordinary functions
gen-url: Private ordinary functions
get-quickdocs-url: Private ordinary functions
get-title: Private ordinary functions
get-url: Private ordinary functions

I
in-cache-p: Private ordinary functions
installed-p: Private ordinary functions

M
make-cache: Private ordinary functions
map-reduce: Private ordinary functions
max-num-next-pages: Private ordinary functions

O
once-only-print-search-results: Private ordinary functions

P
pprint-description: Private ordinary functions
print-line: Private ordinary functions
print-results: Private ordinary functions
print-search-results: Private ordinary functions
print-space: Private ordinary functions

Q
quicksearch: Public ordinary functions

R
remove-tags: Private ordinary functions
response-string: Private ordinary functions

S
search-cache: Private ordinary functions
search-quicklisp: Private ordinary functions
search-web: Private ordinary functions
search-web-by-thread: Private ordinary functions
set-version: Private ordinary functions
store-cache: Private ordinary functions
str: Private ordinary functions
strip: Private ordinary functions


A.3 Variables

Jump to:   *  
S  
Index Entry  Section

*
*cache-size*: Private special variables
*cut-off*: Private special variables
*description-indent-num*: Private special variables
*description-print?*: Private special variables
*installed-prefix*: Private special variables
*max-num-description-columns*: Private special variables
*max-num-web-search-results*: Private special variables
*num-results-per-page*: Private special variables
*print-search-results?*: Private special variables
*quicklisp-verbose?*: Private special variables
*quicksearch-version*: Private special variables
*quicksearch-webpage*: Private special variables
*threading?*: Private special variables
*url-print?*: Private special variables
*user-agent*: Public special variables

S
Special Variable, *cache-size*: Private special variables
Special Variable, *cut-off*: Private special variables
Special Variable, *description-indent-num*: Private special variables
Special Variable, *description-print?*: Private special variables
Special Variable, *installed-prefix*: Private special variables
Special Variable, *max-num-description-columns*: Private special variables
Special Variable, *max-num-web-search-results*: Private special variables
Special Variable, *num-results-per-page*: Private special variables
Special Variable, *print-search-results?*: Private special variables
Special Variable, *quicklisp-verbose?*: Private special variables
Special Variable, *quicksearch-version*: Private special variables
Special Variable, *quicksearch-webpage*: Private special variables
Special Variable, *threading?*: Private special variables
Special Variable, *url-print?*: Private special variables
Special Variable, *user-agent*: Public special variables