Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 1005 Bytes

seq.md

File metadata and controls

51 lines (33 loc) · 1005 Bytes

seq

Numeric sequences

Index

Operation Description
fibonacci, fib Fibonacci sequence
sequence, seq Sequence of integers

Operations

fibonacci

Calculates the nth element in the Fibonacci sequence.

Alias: fib

Stack effects:

( n:Int/u -- Int )

Example:

Input Stack
1 5 seq /fib map 1 | 1 | 2 | 3 | 5

sequence

Places all integers from start to end on to the stack. If start is greater than end, the list of integers is in decreasing order.

Alias: seq

Stack effects:

( start:Int end:Int -- Int* )

Example:

Input Stack
c 4 8 seq 4 | 5 | 6 | 7 | 8
c 8 4 seq 8 | 7 | 6 | 5 | 4