控制流
-
函数
- Abort
- AbortProtect
- Break
- Catch
- CatchExceptions
- CheckAbort
- ChoiceDialog
- Confirm
- ConfirmAssert
- ConfirmBy
- ConfirmMatch
- ConfirmQuiet
- Continue
- Dialog
- DialogInput
- DialogReturn
- Enclose
- Exception
- ExceptionQ
- ExceptionTypeRegisteredQ
- ExceptionTypes
- Goto
- Input
- Interrupt
- Label
- MemoryConstrained
- Pause
- PropagateAborts
- RegisterExceptionType
- Return
- Throw
- ThrowException
- TimeConstrained
- WithCleanup
- 相关指南
- 技术笔记
-
-
函数
- Abort
- AbortProtect
- Break
- Catch
- CatchExceptions
- CheckAbort
- ChoiceDialog
- Confirm
- ConfirmAssert
- ConfirmBy
- ConfirmMatch
- ConfirmQuiet
- Continue
- Dialog
- DialogInput
- DialogReturn
- Enclose
- Exception
- ExceptionQ
- ExceptionTypeRegisteredQ
- ExceptionTypes
- Goto
- Input
- Interrupt
- Label
- MemoryConstrained
- Pause
- PropagateAborts
- RegisterExceptionType
- Return
- Throw
- ThrowException
- TimeConstrained
- WithCleanup
- 相关指南
- 技术笔记
-
函数
控制流
传统的过程式编程语言通常需要程序员在他们的程序的每一步定义明确的"控制流". Wolfram 语言提供标准的流控制命令,以及各种符号能力的扩展——尽管更高层次的程序模式通常并不需要程序员指定控制流的细节.
Return — 从任意函数返回
Break, Continue — 过程式循环结构中的中断、持续
Throw — “抛出”任意表达式,以便被外围的 Catch “捕获”
Confirm — 确认对表达式的计算不会生成失败
ConfirmBy ▪ ConfirmMatch ▪ ConfirmQuiet ▪ ConfirmAssert
Exception — 创建特定类型的异常
ThrowException — 抛出特定类型的异常
CatchExceptions — 捕获并处理指定类型的异常
ExceptionQ ▪ ExceptionTypes ▪ RegisterExceptionType ▪ ExceptionTypeRegisteredQ
WithCleanup — 在返回表达式值前进行清除
Abort — 取消
Interrupt ▪ CheckAbort ▪ AbortProtect ▪ PropagateAborts
TimeConstrained, MemoryConstrained — 在约束条件下运行
Pause — 指定时间的停顿
Dialog — 一个子对话框的初始化