-
-
Notifications
You must be signed in to change notification settings - Fork 48
None
Giorgio Garofalo edited this page Jan 22, 2025
·
10 revisions
None is a particular kind of value, which represents nothing or emptiness (similarly to null
in many programming languages).
This value could be returned by functions (instantiated via .none
), although primarily used as a placeholder value for optional parameters.
Function | Description | Return type |
---|---|---|
.isnone {value} |
Checks whether value is none . |
Boolean |
.otherwise {value} {fallback} |
Returns value if it is not none , fallback otherwise.Works best with function call chaining. |
type of either value or fallback
|
.takeif {value} {lambda} |
Returns value if the boolean-returning lambda is accepted on value . Returns none otherwise.Works best with function call chaining. |
type of value , or none
|
Hi! I'm .name::otherwise {unnamed}
If
name
isJohn
: Hi! I'm John
If it isnone
: Hi! I'm unnamed
.num::takeif {@lambda x: .x::equals {5}}
If
num
is 5: 5
If it isnone
: NoneConfused about
@lambda
? It begins an inlineLambda
. Check its page for further details.
- Figures
- Image size
- TeX formulas
- Table caption
- Decorative headings
- Alerts (quote types)
- Quotation source
- Page breaks
- Text symbols (text replacement)
- Syntax of a function call
- Declaring functions
- Dynamic typing
- Including other Quarkdown files
- Importing external libraries
- Localization
- Document metadata
- Theme
- Page format
- Page margin content
- Page counter
- Automatic page break
- Numbering
- Paragraph style
- Caption position
- Table of contents
- Stacks (row, column, grid)
- Container
- Align
- Float
- Figure
- Clip
- Box
- Collapsible
- Whitespace
- Variables
- Optionality
- Math
- Conditional statements
- Loops
- Let
- Destructuring
- String manipulation
- Table manipulation: sorting, computing, and more
- Generators
- String
- Number
- Markdown content
- Boolean
- None
- Enumeration entry
- Iterable
- Dictionary
- Range
- Lambda
- Size(s)
- Color
- Dynamic
- Paper: abstract, definitions, theorems, and more