export

export given container children to current scope


Parameters

export module :dictionary :object :module

Attributes

all export everything, regardless of whether it's been marked as public (makes sense only for modules)

Returns

  • :nothing

Examples

copy
greeting: module [ greet: method.public [user :string][ print ~"Hello, |user|!" ] ] export greeting! greet "Anonymous" ; Hello, Anonymous!

copy
; You can't use private methods greeting: module [ greet: method [user :string][ print ~"Bye, bye, |user|!" ] ] export greeting! greet "Anonymous" ; Cannot resolve requested value ; ; Identifier not found: ; greet ; ; ┃ File: example.art ; ┃ Line: 9 ; ┃ ; ┃ 7 ║ ] ; ┃ 8 ║ ; ┃ 9 ║► export greeting! ; ┃ 10 ║ ; ┃ 11 ║ greet "Anonymous" ; ; Hint: Perhaps you meant... greeting ? ; or... repeat ? ; or... greater? ?

copy
; You can export private functions using the `.all` attribute greeting: module [ greet: method [user :string][ print ~"Bye, bye, |user|!" ] ] export.all greeting! greet "Anonymous" ; Bye, bye, Anonymous!

Related