]> gitweb.factorcode.org Git - factor.git/blob - extra/readline/readline-docs.factor
Raw FFI bindings to libreadline and a few higher level words
[factor.git] / extra / readline / readline-docs.factor
1 ! Copyright (C) 2011 Erik Charlebois.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: arrays help.markup help.syntax math
4 sequences.private vectors strings kernel math.order layouts
5 quotations generic.single ;
6 IN: readline
7
8 HELP: readline
9 { $values
10     { "prompt" string }
11     { "str" string }
12 }
13 { $description "Read a line from using readline." } ;
14
15 HELP: set-completion
16 { $values
17     { "quot" "a quotation with stack effect ( str n -- str )"}
18 }
19 { $description "Set the given quotation as the completion hook for readline. The quotation is called with the string to complete and the index in the completion list to return. When all completions have been returned, returning " { $snippet "f" } " terminates the loop." }
20 { $examples
21     { $example "USING: readline sequences combinators kernel ;"
22                "[ nip [ \"keep\" \"dip\" ] ?nth ] set-completion"
23                ""
24     }
25 } ;
26
27 ARTICLE: "readline" "Readline"
28 { $vocab-link "readline" }
29 ;
30
31
32 ABOUT: "readline"