交互式组件

Base.Docs.apropos — Function.

  1. apropos(string)

Search through all documentation for a string, ignoring case.

InteractiveUtils.varinfo — Function.

  1. varinfo(m::Module=Main, pattern::Regex=r"")

Return a markdown table giving information about exported global variables in a module, optionally restricted to those matching pattern.

The memory consumption estimate is an approximate lower bound on the size of the internal structure of the object.

InteractiveUtils.versioninfo — Function.

  1. versioninfo(io::IO=stdout; verbose::Bool=false)

Print information about the version of Julia in use. The output is controlled with boolean keyword arguments:

  • verbose: print all additional information

InteractiveUtils.methodswith — Function.

  1. methodswith(typ[, module or function]; supertypes::Bool=false])

Return an array of methods with an argument of type typ.

The optional second argument restricts the search to a particular module or function (the default is all top-level modules).

If keyword supertypes is true, also return arguments with a parent type of typ, excluding type Any.

InteractiveUtils.subtypes — Function.

  1. subtypes(T::DataType)

Return a list of immediate subtypes of DataType T. Note that all currently loaded subtypes are included, including those not visible in the current module.

Examples

  1. julia> subtypes(Integer)
  2. 3-element Array{Any,1}:
  3. Bool
  4. Signed
  5. Unsigned

InteractiveUtils.edit — Method.

  1. edit(path::AbstractString, line::Integer=0)

Edit a file or directory optionally providing a line number to edit the file at. Return to the julia prompt when you quit the editor. The editor can be changed by setting JULIA_EDITOR, VISUAL or EDITOR as an environment variable.

InteractiveUtils.edit — Method.

  1. edit(function, [types])

Edit the definition of a function, optionally specifying a tuple of types to indicate which method to edit. The editor can be changed by setting JULIA_EDITOR, VISUAL or EDITOR as an environment variable.

InteractiveUtils.@edit — Macro.

  1. @edit

Evaluates the arguments to the function or macro call, determines their types, and calls the edit function on the resulting expression.

InteractiveUtils.less — Method.

  1. less(file::AbstractString, [line::Integer])

Show a file using the default pager, optionally providing a starting line number. Returns to the julia prompt when you quit the pager.

InteractiveUtils.less — Method.

  1. less(function, [types])

Show the definition of a function using the default pager, optionally specifying a tuple of types to indicate which method to see.

InteractiveUtils.@less — Macro.

  1. @less

Evaluates the arguments to the function or macro call, determines their types, and calls the less function on the resulting expression.

InteractiveUtils.@which — Macro.

  1. @which

Applied to a function or macro call, it evaluates the arguments to the specified call, and returns the Method object for the method that would be called for those arguments. Applied to a variable, it returns the module in which the variable was bound. It calls out to the which function.

InteractiveUtils.@functionloc — Macro.

  1. @functionloc

Applied to a function or macro call, it evaluates the arguments to the specified call, and returns a tuple (filename,line) giving the location for the method that would be called for those arguments. It calls out to the functionloc function.

InteractiveUtils.@code_lowered — Macro.

  1. @code_lowered

Evaluates the arguments to the function or macro call, determines their types, and calls code_lowered on the resulting expression.

InteractiveUtils.@code_typed — Macro.

  1. @code_typed

Evaluates the arguments to the function or macro call, determines their types, and calls code_typed on the resulting expression. Use the optional argument optimize with

  1. @code_typed optimize=true foo(x)

to control whether additional optimizations, such as inlining, are also applied.

InteractiveUtils.code_warntype — Function.

  1. code_warntype([io::IO], f, types; verbose_linetable=false)

Prints lowered and type-inferred ASTs for the methods matching the given generic function and type signature to io which defaults to stdout. The ASTs are annotated in such a way as to cause "non-leaf" types to be emphasized (if color is available, displayed in red). This serves as a warning of potential type instability. Not all non-leaf types are particularly problematic for performance, so the results need to be used judiciously. In particular, unions containing either missing or nothing are displayed in yellow, since these are often intentional. If the verbose_linetable keyword is set, the linetable will be printed in verbose mode, showing all available information (rather than applying the usual heuristics). See @code_warntype for more information.

InteractiveUtils.@code_warntype — Macro.

  1. @code_warntype

Evaluates the arguments to the function or macro call, determines their types, and calls code_warntype on the resulting expression.

InteractiveUtils.code_llvm — Function.

  1. code_llvm([io=stdout,], f, types)

Prints the LLVM bitcodes generated for running the method matching the given generic function and type signature to io.

If the optimize keyword is unset, the code will be shown before LLVM optimizations. All metadata and dbg.* calls are removed from the printed bitcode. Set the raw keyword for the full IR. To dump the entire module that encapsulates the function, with debug info and metadata, set the dump_module keyword.

InteractiveUtils.@code_llvm — Macro.

  1. @code_llvm

Evaluates the arguments to the function or macro call, determines their types, and calls code_llvm on the resulting expression. Set the optional keyword arguments raw, dump_module and optimize by putting them and their value before the function call, like this:

  1. @code_llvm raw=true dump_module=true f(x)
  2. @code_llvm optimize=false f(x)

optimize controls whether additional optimizations, such as inlining, are also applied. raw makes all metadata and dbg.* calls visible. dump_module prints the entire module that encapsulates the function, with debug info and metadata.

InteractiveUtils.code_native — Function.

  1. code_native([io=stdout,], f, types; syntax = :att)

Prints the native assembly instructions generated for running the method matching the given generic function and type signature to io. Switch assembly syntax using syntax symbol parameter set to :att for AT&T syntax or :intel for Intel syntax.

InteractiveUtils.@code_native — Macro.

  1. @code_native

Evaluates the arguments to the function or macro call, determines their types, and calls code_native on the resulting expression.

InteractiveUtils.clipboard — Function.

  1. clipboard(x)

Send a printed form of x to the operating system clipboard ("copy").

  1. clipboard() -> AbstractString

Return a string with the contents of the operating system clipboard ("paste").