基本功能
介绍
Julia Base 中包含一系列适用于科学及数值计算的函数和宏,但也可以用于通用编程,其它功能则由 Julia 生态圈中的各种库来提供。函数按主题划分如下:
一些通用的提示:
可以通过
Import Module导入想要使用的模块,并利用Module.fn(x)语句来实现对模块内函数的调用。此外,
using Module语句会将名为Module的模块中的所有可调函数引入当前的命名空间。- 按照约定,名字以感叹号(
!)结尾的函数会改变其输入参数的内容。 一些函数同时拥有改变参数(例如sort!)和不改变参数(sort)的版本
The behaviors of Base and standard libraries are stable as defined in
SemVer only if they are documented; i.e., included in the
Julia documentation and not marked as unstable.
See API FAQ for more information.
Getting Around
Base.exitBase.atexitBase.isinteractiveBase.summarysizeBase.requireBase.compilecacheBase.__precompile__Base.includeBase.MainInclude.includeBase.include_stringBase.include_dependencyBase.which(::Any, ::Any)Base.methodsBase.@showansBase.active_project
Keywords
This is the list of reserved keywords in Julia:
baremodule, begin, break, catch, const, continue, do,
else, elseif, end, export, false, finally, for, function,
global, if, import, let, local, macro, module, quote,
return, struct, true, try, using, while.
Those keywords are not allowed to be used as variable names.
The following two-word sequences are reserved:
abstract type, mutable struct, primitive type.
However, you can create variables with names:
abstract, mutable, primitive and type.
Finally:
where is parsed as an infix operator for writing parametric method and type definitions;
in and isa are parsed as infix operators;
and outer is parsed as a keyword when used to modify the scope of a variable in an iteration specification of a for loop or generator expression.
Creation of variables named where, in, isa or outer is allowed though.
moduleexportimportusingbaremodulefunctionmacroreturndobeginendletifforwhilebreakcontinuetryfinallyquotelocalglobalconststructmutable structabstract typeprimitive typewhere...;=?:
Standard Modules
MainCoreBase
Base Submodules
Base.BroadcastBase.DocsBase.IteratorsBase.LibcBase.MetaBase.StackTracesBase.SysBase.ThreadsBase.GC
All Objects
Core.:(===)Core.isaBase.isequalBase.islessBase.ifelseCore.typeassertCore.typeofCore.tupleBase.ntupleBase.objectidBase.hashBase.finalizerBase.finalizeBase.copyBase.deepcopyBase.getpropertyBase.setproperty!Base.propertynamesBase.haspropertyCore.getfieldCore.setfield!Core.isdefinedBase.@isdefinedBase.convertBase.promoteBase.oftypeBase.widenBase.identity
Properties of Types
Type relations
Base.supertypeCore.TypeCore.DataTypeCore.:(<:)Base.:(>:)Base.typejoinBase.typeintersectBase.promote_typeBase.promote_ruleBase.promote_typejoinBase.isdispatchtuple
Declared structure
Base.ismutableBase.isimmutableBase.isabstracttypeBase.isprimitivetypeBase.issingletontypeBase.isstructtypeBase.nameof(::DataType)Base.fieldnamesBase.fieldnameBase.hasfield
Memory layout
Base.sizeof(::Type)Base.isconcretetypeBase.isbitsBase.isbitstypeCore.fieldtypeBase.fieldtypesBase.fieldcountBase.fieldoffsetBase.datatype_alignmentBase.datatype_haspaddingBase.datatype_pointerfree
Special values
Base.typeminBase.typemaxBase.floatminBase.floatmaxBase.maxintfloatBase.eps(::Type{<:AbstractFloat})Base.eps(::AbstractFloat)Base.instances
Special Types
Core.AnyCore.UnionUnion{}Core.UnionAllCore.TupleCore.NTupleCore.NamedTupleBase.@NamedTupleBase.ValCore.VarargCore.NothingBase.isnothingBase.notnothingBase.SomeBase.somethingBase.@somethingBase.Enums.EnumBase.Enums.@enumCore.ExprCore.SymbolCore.Symbol(x...)Core.Module
Generic Functions
Core.FunctionBase.hasmethodCore.applicableBase.isambiguousCore.invokeBase.@invokeBase.invokelatestBase.@invokelatestnewBase.:(|>)Base.:(∘)Base.ComposedFunctionBase.splatBase.Fix1Base.Fix2
Syntax
Core.evalBase.MainInclude.evalBase.@evalBase.evalfileBase.escBase.@inboundsBase.@boundscheckBase.@propagate_inboundsBase.@inlineBase.@noinlineBase.@nospecializeBase.@specializeBase.gensymBase.@gensymvar"name"Base.@gotoBase.@labelBase.@simdBase.@pollyBase.@generatedBase.@pureBase.@deprecate
Missing Values
Base.MissingBase.missingBase.coalesceBase.@coalesceBase.ismissingBase.skipmissingBase.nonmissingtype
System
Base.runBase.devnullBase.successBase.process_runningBase.process_exitedBase.kill(::Base.Process, ::Integer)Base.Sys.set_process_titleBase.Sys.get_process_titleBase.ignorestatusBase.detachBase.CmdBase.setenvBase.addenvBase.withenvBase.pipeline(::Any, ::Any, ::Any, ::Any...)Base.pipeline(::Base.AbstractCmd)Base.Libc.gethostnameBase.Libc.getpidBase.Libc.time()Base.time_nsBase.@timeBase.@timevBase.@timedBase.@elapsedBase.@allocatedBase.EnvDictBase.ENVBase.Sys.isunixBase.Sys.isappleBase.Sys.islinuxBase.Sys.isbsdBase.Sys.isfreebsdBase.Sys.isopenbsdBase.Sys.isnetbsdBase.Sys.isdragonflyBase.Sys.iswindowsBase.Sys.windows_versionBase.Sys.free_memoryBase.Sys.total_memoryBase.@static
Versioning
Base.VersionNumberBase.@v_str
Errors
Base.errorCore.throwBase.rethrowBase.backtraceBase.catch_backtraceBase.current_exceptionsBase.@assertBase.Experimental.register_error_hintBase.Experimental.show_error_hintsBase.ArgumentErrorBase.AssertionErrorCore.BoundsErrorBase.CompositeExceptionBase.DimensionMismatchCore.DivideErrorCore.DomainErrorBase.EOFErrorCore.ErrorExceptionCore.InexactErrorCore.InterruptExceptionBase.KeyErrorBase.LoadErrorBase.MethodErrorBase.MissingExceptionCore.OutOfMemoryErrorCore.ReadOnlyMemoryErrorCore.OverflowErrorBase.ProcessFailedExceptionCore.StackOverflowErrorBase.SystemErrorCore.TypeErrorCore.UndefKeywordErrorCore.UndefRefErrorCore.UndefVarErrorBase.StringIndexErrorBase.InitErrorBase.retryBase.ExponentialBackOff
Events
Base.Timer(::Function, ::Real)Base.TimerBase.AsyncConditionBase.AsyncCondition(::Function)
Reflection
Base.nameof(::Module)Base.parentmoduleBase.pathof(::Module)Base.pkgdir(::Module)Base.moduleroot__module____source__Base.@__MODULE__Base.@__FILE__Base.@__DIR__Base.@__LINE__Base.fullnameBase.namesCore.nfieldsBase.isconstBase.nameof(::Function)Base.functionloc(::Any, ::Any)Base.functionloc(::Method)Base.@locals
Internals
Base.GC.gcBase.GC.enableBase.GC.@preserveBase.GC.safepointMeta.lowerMeta.@lowerMeta.parse(::AbstractString, ::Int)Meta.parse(::AbstractString)Meta.ParseErrorCore.QuoteNodeBase.macroexpandBase.@macroexpandBase.@macroexpand1Base.code_loweredBase.code_typedBase.precompile
Meta
Meta.quotMeta.isexprMeta.isidentifierMeta.isoperatorMeta.isunaryoperatorMeta.isbinaryoperatorMeta.show_sexpr
