sourceuserlibs/Greetings.xtl
1⍝# Greetings: a library with a private name. h:n_ame is file-private, so it is
2⍝# used here but cannot be imported; g_reet is exported, and takes the
3⍝# greeting from the program that calls it. Import it with an alias of
4⍝# your choice: "g:" u_se< "Greetings" (it is found in userlibs/).
5
6⍝# The name a greeting is addressed to, the logo drawn (niladic: call
7⍝# it with @).
8ʰn̲ame ← { @ → "X̲ᵉTᵃL" } ⍝ private
9
10⍝# The greeting g, given by the caller, followed by the name: monadic,
11⍝# ᵍg̲reet "hi".
12⍝# >> "g:" u_se< "Greetings"
13⍝# >> g:g_reet "hi"
14⍝# hi X̲ᵉTᵃL
15ˡg̲reet ← { g → g c̲at " " c̲at ʰn̲ame @ } ⍝ monadic: the greeting