create new module with given contents
Parameters
module contents :dictionary :block
Attributes
with |
:block |
use given initialization parameters |
Returns
Examples
copy
ui: module [
namedRule: method [title :string width :integer][
title: ~" |title| "
pad.center.with: '=' title width
]
section: method.public [title :string content :string width :integer][
~{
|\namedRule title width|
|content|
|\namedRule title width|
}
]
]
export ui!
print section "Hello" "World" 50
; ===================== Hello ======================
; World
; ===================== Hello ======================
print set? 'ui ; true
print set? 'namedRule ; false
print set? 'section ; true
copy
ui: [
init: method [symbol :char][
\symbol: symbol
]
namedRule: method [title :string width :integer][
title: ~" |title| "
pad.center.with: \symbol title width
]
section: method.public [title :string content :string width :integer][
~{
|\namedRule title width|
|content|
|\namedRule title width|
}
]
]
export module.with: ['~'] ui!
print section "Example" "This is an example" 40
; ~~~~~~~~~~~~~~~ Example ~~~~~~~~~~~~~~~~
; This is an example
; ~~~~~~~~~~~~~~~ Example ~~~~~~~~~~~~~~~~
Related