123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657letget_descx=#ifOCAML_VERSION>=(4,14,0)Types.get_descx#elsex.Types.desc#endiflettoploop_get_directivename=#ifOCAML_VERSION>=(4,13,0)Toploop.get_directivename#elsetrySome(Hashtbl.findToploop.directive_tablename)withNot_found->None#endiflet toploop_all_directive_names()=#ifOCAML_VERSION>=(4,13,0)Toploop.all_directive_names()#elseHashtbl.fold(fun dir_acc->dir::acc)Toploop.directive_table[]#endifletset_load_pathpath=#ifOCAML_VERSION>=(5,0,0)Load_path.initpath~auto_include:Load_path.no_auto_include#elseLoad_path.initpath#endiflettoploop_use_silently fmtname=#ifOCAML_VERSION>=(4,14,0)Toploop.use_silentlyfmt(matchnamewith""->Stdin|_->Filename)#elseToploop.use_silentlyfmtname#endiflettoploop_set_paths()=#ifOCAML_VERSION>=(5,0,0)Toploop.set_paths~auto_include:Load_path.no_auto_include()#elseToploop.set_paths ()#endiflettoploop_load_fileppffn=#ifOCAML_VERSION>=(4,13,0)Toploop.load_fileppffn#elseTopdirs.load_fileppffn#endif(** Returns whether the given path is persistent. *)letrecis_persistent_path=function|Path.Pidentid->Ident.persistentid|Path.Pdot(p,_)->is_persistent_pathp|Path.Papply(_,p)->is_persistent_pathp#ifOCAML_VERSION>=(5,1,0)|Path.Pextra_ty(p,_)->is_persistent_pathp#endif