Skip to content

Commands

hhas edited this page Feb 4, 2023 · 2 revisions

Shell commands

help

clear

commands

operators

read {prompt as optional string with_default “?”} returning string

say {message as string} returning string

pp {value as optional}

spp {value as optional}

unset {name as name}

quit

Type ‘help’ in the interactive shell to view documentation.

Standard library commands

(Commands which have operator syntax are omitted; see Operators for a full list.)

app {bundle_identifier as string} returning value

format_code {value as anything} returning string

lowercase {text as string} returning string

uppercase {text as string} returning string

write {value as anything}

(app is currently used by aelib but will go away once global @Apps namespace is implemented; write is currently limited to stdout, c.f. Swift print)

Example of use (using “pipe” syntax):

✎ "Bob"; uppercase; format_code; write
“““BOB”””
☺︎ nothing

Tip: Use pp/spp to inspect the previous line as a value (a group of expressions):

✎ pp
((write (format_code (uppercase “Bob”))))

Type commands

These return coercion objects, for use in as casts and handler signatures:

anything

block

boolean

choice {options as ordered_list (symbol)}

coercion

‘editable’ {of_type: value_type as optional coercion with_default anything}

handler

keyed_list {key_type as optional coercion with_default value, value_type as optional coercion with_default anything}

ordered_list {of: type as optional coercion with_default anything, from: minimum as optional integer, to: maximum as optional integer}

‘nothing’

number {whole as optional {boolean, with_default: false}, from: minimum as optional {number}, to: maximum as optional {number}}

‘optional’ {of_type: value_type as optional coercion with_default value, with_default: default_value as anything}

ordered_list {of: type as optional coercion with_default anything, from: minimum as optional integer, to: maximum as optional integer}

record {of_type: record_type as optional record_type}

string

symbol

value
Clone this wiki locally