123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157(** [Defun] is an applicative binding of Elisp [defun].
It does for Elisp what [Command] does for the command line. *)open!Coreopen!Async_kernelopen!ImportmoduletypeS=sigtype'atvalreturn:'a->'atvalmap:'at->f:('a->'b)->'btvalboth:'at->'bt->('a*'b)tvalrequired:string->'aValue.Type.t->'atvaloptional:string->'aValue.Type.t->'aoptiontvalrest:string->'aValue.Type.t->'alisttvaloptional_with_default:string->'a->'aValue.Type.t->'at(** An optional argument whose [Value.Type.t] handles [nil] directly. *)valoptional_with_nil:string->'aValue.Type.t->'atincludeValue.Type.SendmoduleObsoletes=structmoduleSince=structtypet=Sinceofstring[@@derivingsexp_of]endtypet=Symbol.t*Since.t[@@derivingsexp_of]endmoduletypeDefun=sigmoduleObsoletes=Obsoletestype'at[@@derivingsexp_of]moduleOpen_on_rhs_intf:sigmoduletypeS=Swithtype'at='atendincludeApplicative.Let_syntaxwithtype'at:='atwithmoduleOpen_on_rhs_intf:=Open_on_rhs_intfincludeOpen_on_rhs_intf.Swithtype'at:='atmoduleInteractive:sigtypet=|Argsof(unit->Value.tlistDeferred.t)(** When a command defined with [~interactive:(Args f)] is called interactively, [f
()] is called to compute the argument values to supply to the command. Of
course, the argument values should match the command's [Defun.t]
specification. *)|Function_nameof{prompt:string}|Ignored|No_arg|Promptofstring|Raw_prefix|RegionincludeValueable.Swithtypet:=tendmoduleFor_testing:sigvalall_defun_symbols:unit->Symbol.tlistend(** An [Returns.t] states the return type of a function and whether the function returns
a value of that type directly or via a [Deferred.t]. An [(a, a) Returns.t] means
that the function returns [a] directly. An [(a, a Deferred.t) Returns.t] means that
the function returns [a] via an [a Deferred.t]. *)moduleReturns:sigtype(_,_)t=|Returns:'aValue.Type.t->('a,'a)t|Returns_deferred:'aValue.Type.t->('a,'aDeferred.t)t[@@derivingsexp_of]valreturn:('a,'b)t->'a->'bvalreturns:('a,'b)Sync_or_async.t->'aValue.Type.t->('a,'b)tendtype'adefun:=Symbol.t->Source_code_position.t->docstring:string->?define_keys:(Keymap.t*string)list->?obsoletes:Obsoletes.t->?should_profile:bool->?interactive:Interactive.t->?disabled:bool(** See {!Symbol.Property.function_disabled} *)->?evil_config:Evil.Config.t->'avaldefun:((_,'a)Returns.t->'at->unit)defunvaldefun_nullary:((_,'a)Returns.t->(unit->'a)->unit)defunvaldefun_nullary_nil:((unit->unit)->unit)defun(** [(describe-function 'defalias)]
[(Info-goto-node "(elisp)Defining Functions")] *)valdefalias:Symbol.t->Source_code_position.t->?docstring:string->alias_of:Symbol.t->unit->unit(** [(describe-function 'define-obsolete-function-alias)]
N.B. Load order matters. A subsequent [defun] will override the aliasing. *)valdefine_obsolete_alias:Symbol.t->Source_code_position.t->?docstring:string->alias_of:Symbol.t->since:string->unit->unitvallambda:Source_code_position.t->?docstring:string->?interactive:Interactive.t->(_,'a)Returns.t->'at->Function.tvallambda_nullary:Source_code_position.t->?docstring:string->?interactive:Interactive.t->(_,'a)Returns.t->(unit->'a)->Function.tvallambda_nullary_nil:Source_code_position.t->?docstring:string->?interactive:Interactive.t->(unit->unit)->Function.t(** [apply t args ~function_ ~defined_at] applies [args] to [t], using [function_] and
[defined_at] to construct a nice error message if [args] are not what [t] expects.
It helps define functions which must inspect some of their arguments to determine
the number and type of the remaining arguments. *)valapply:'at->Value.tarray->function_:Sexp.t->defined_at:Lexing.position->'aend