You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: Doc/Reference/Constants-and-logging.md
+33-9Lines changed: 33 additions & 9 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,30 +1,30 @@
1
-
*Sources: Status.cs, Raw.cs - Last Updated: 2020.11.15*
1
+
*Sources: Status.cs, Raw.cs - Last Updated: 2020.12.04*
2
2
3
-
# Status keywords and logging calls
3
+
# Status keywords, logging calls and expression wrappers
4
4
5
-
Since 2020.11.15 statically importing `Active.Core.status` is discouraged; keywords (or logging calls) are made available via statically importing either`Active.Raw` or `Active.Status`.
5
+
Keywords and logging calls are made available via statically importing `Active.Raw` or `Active.Status`.
6
6
7
7
`Active.Raw` is recommended for best performance or if you are not using the logging API.
8
8
With regard to performance logging overheads are small and the tradeoff is only meaningful when optimising critical sections.
9
9
10
-
`Active.Status` enables concise logging calls, as described in the [logging API documentation](Logging.md).
10
+
`Active.Status` enables logging calls, as described in the [logging API documentation](Logging.md).
11
11
12
-
Using `Active.Raw` does not disable logging. It only provides alternative semantics. The gist of it is you can't really have `done` and `done()` in the same namespace. Even with `Active.Raw` you can still issue a logging call via `status.done(..)`.
12
+
Using `Active.Raw` does not disable logging. It only provides alternative semantics. Even when using `Active.Raw` you may still issue a logging call via `status.done(..)`.
13
13
14
14
Importing `static Active.Raw` in one file and `static Active.Status` in another is also not a problem.
15
15
16
-
## Statuses and certainties via `Active.Raw`
16
+
## Active.Raw
17
17
18
-
If you statically import `Active.Raw`, status constants do not emit logging information and the following keywords are available:
18
+
If you statically import `Active.Raw`, status constants do not emit logging information; keywords:
impending.done() // will not compile since 'impending' never succeeds
44
44
```
45
+
46
+
## Expression wrappers
47
+
48
+
Via `Active.Raw` or `Active.Status`, use a wrapper to include any expression within a status expression, then return an arbitrary status constant; here is an example:
0 commit comments