The REPL's :show prints the doc of a visible name
🤖 Generated with [ECA](https://eca.dev) Co-Authored-By: eca-agent <git@eca.dev>
This commit is contained in:
parent
5924aa27bc
commit
96d6ebc8e2
1 changed files with 26 additions and 1 deletions
|
|
@ -1312,4 +1312,29 @@ bjo> (g 10)
|
||||||
12
|
12
|
||||||
}|
|
}|
|
||||||
|
|
||||||
The same incremental compilation model applies to trait implementations (@code{impl}): an implementation entered at the prompt is visible to subsequent entries, but cannot retroactively modify calls compiled earlier. Type @code{:help} to view available REPL commands, or press @code{Ctrl-D} (or type @code{:quit}) to exit.
|
The same incremental compilation model applies to trait implementations (@code{impl}): an implementation entered at the prompt is visible to subsequent entries, but cannot retroactively modify calls compiled earlier.
|
||||||
|
|
||||||
|
@code{:show name} prints the documentation of a name you can use at the prompt: what it is, where it comes from, how it is called, and the text its author wrote in a @code{(:doc ...)} form. It then lists the other usable names containing the text, in any case, with their modules and one-line summaries. Only names that an entry typed now could use are considered, that is builtins, names your imports bring in, and names defined at the prompt. So @code{:show random-bool} prints nothing until @code{(std random)} is imported:
|
||||||
|
|
||||||
|
@codeblock[#:lang "text"]|{
|
||||||
|
bjo> :show random-bool
|
||||||
|
bjo> (import (std random))
|
||||||
|
bjo> :show random-bool
|
||||||
|
random-bool: function from (std random)
|
||||||
|
(random-bool #:rng (parameter-ref current-random))
|
||||||
|
: (-> (#:rng RandomSource) bool)
|
||||||
|
|
||||||
|
#t or #f, equally likely.
|
||||||
|
|
||||||
|
#:rng The source to draw from.
|
||||||
|
returns One random bit. They are drawn 64 at a time.
|
||||||
|
|
||||||
|
See also: random-chance?
|
||||||
|
bjo> :show random-u
|
||||||
|
random-u32 (std random) 32 random bits.
|
||||||
|
random-u64 (std random) 64 random bits.
|
||||||
|
}|
|
||||||
|
|
||||||
|
Import modifiers apply as they would in an entry: after @code{(import (prefix (std random) "r/"))} the name to ask about is @code{r/random-bool}, and @code{:show} says that it is @code{random-bool} from @code{(std random)}. A name with no documentation is shown with where it comes from and "with no doc".
|
||||||
|
|
||||||
|
Type @code{:help} to view available REPL commands, or press @code{Ctrl-D} (or type @code{:quit}) to exit.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue