all repos — min @ fdcacd95b472f3dd952e88834ff0fdfcbdd61472

A small but practical concatenative programming language.

site/contents/_includes/_reference-seq.md

 1
 2
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
{@ _defs_.md || 0 @}

{#op||all?||(2) (1)||B||
Applies predicate {{1}} to each element of {{2}} and returns {{t}} if all elements of {{2}} satisfy predicate {{1}}. #}

{#op||any?||(2) (1)||B||
Applies predicate {{1}} to each element of {{2}} and returns {{t}} if at least one element of {{2}} satisfies predicate {{1}}. #}

{#op||append||\* (1)||(\*)||
Returns a new quotation containing the contents of {{1}} with {{any}} appended. #}

{#op||apply||(1)||(\*)||
Returns a new quotation {{q}} obtained by evaluating each element of {{1}} in a separate stack.#}

{#op||at||(\*) I||\*||
Returns the {{i}}^th element of {{q}}.#}

{#op||concat||(2) (1)||(\*)||
Concatenates {{2}} with {{1}}. #}

{#op||ddel||(D) §||(D')||
Returns a copy of {{d}} without the element with key {{sl}}. #}

{#op||filter||(2) (1)||(\*)||
> Returns a new quotation {{q}} containing all elements of {{2}} that satisfy predicate {{1}}.
> 
> > %sidebar%
> > Example
> > 
> > The following program returns [(2 6 8 12)](class:kwd):
> > 
> >     (1 37 34 2 6 8 12 21) 
> >     (dup 20 < swap even? and) filter #}

{#op||dget||(D) §||\*||
Returns the value of key {{sl}}. #}

{#op||dhas?||(D) §||B||
> Returns {{t}} if dictionary {{d}} contains the key {{sl}}.
> 
> > %sidebar%
> > Example
> >  
> > The following program returns {{t}}:
> > 
> >     ((a1 true) (a2 "aaa") (a3 false)) 'a2 dhas?
 #}

{#op||dset||(D) \* §||(D')||
Sets the values of the {{sl}} of {{d}}  to {{any}}, and return a modified copy of {{d}}. #}

{#op||first||(\*)||\*||
Returns the first element of {{q}}. #}

{#op||in?||(\*) \*||B||
Returns {{t}} if {{any}} is contained in {{q}}.#}

{#op||keys||(D)||(S+)||
Returns a quotation containing all the keys of dictionary {{d}}. #}

{#op||map||(2) (1)||(\*)||
Returns a new quotation {{q}} obtained by applying {{1}} to each element of {{2}}.#}

{#op||prepend||\* (\*)||(\*)||
Returns a new quotation containing the contents of {{q}} with [\*](class:kwd) prepended. #}

{#op||rest||(\*)||(\*)||
Returns a new quotation containing all elements of the input quotation except for the first. #}

{#op||reverse||(1)||(\*)||
Returns a new quotation {{q}} containing all elements of {{1}} in reverse order. #}

{#op||shorten||(\*) I||(\*)||
Returns a quotation containing the first {{i}} values of the input quotation. #}

{#op||size||(\*)||I||
Returns the length of {{q}}.#}

{#op||sort||(2) (1)||(\*)||
> Sorts all elements of {{2}} according to predicate {{1}}. 
> 
> > %sidebar%
> > Example
> > 
> > The following programs returns [(1 3 5 7 9 13 16)](class:kwd):
> > 
> >     (1 9 5 13 16 3 7) '> sort #}

{#op||values||(D)||(\*+)||
Returns a quotation containing all the values of dictionary {{d}}. #}