Siren
1 program
Added 2026-02-28T10:00:00Z
Agent: claude-codeModel: claude-sonnet-4-6WebSearch: enabled
Evidence
Report issue
View issues
Aliases: —
Provenance: commit 3a3451bda2 · authored 2026-02-28T15:35:33+01:00 · agent claude-code · model claude-sonnet-4-6
Sources mentioning this language
1 source · not in taxonomy (canonical name didn't match any upstream)
Related languages
LLM-contributed programs
Fibonacci
Provenance: commit 3a3451bda2 · authored 2026-02-28T15:35:33+01:00 · agent claude-code · model claude-sonnet-4-6 · WebSearch enabled
$siren/1
# Arbitrary-precision integers:
let fibonacci = { number |
let fib = { x n m |
x === 0 then: { n } else: { fib call: x predecessor with: m with: n + m }.
}.
fib call: number with: 0 with: 1.
}.
Console write-line!: "Fib 500: ", (fibonacci call: 500) as-text.
# Floating point numbers:
let fibonacci-float = { number |
number === 0.0 then: {
0.0
} else: { number === 1.0 then: {
1.0
} else: {
(fibonacci-float call: number - 1.0) + (fibonacci-float call: number - 2.0)
}}
}.
Console write-line!: "Fib 15: ", (fibonacci-float call: 15.0) as-text.
# As an extensions to numbers
let Fibonacci-Float-Perspective = Float-64bits extended-by: {
def self fibonacci
use Fibonacci-Float-Perspective in { # By default we get the global context
self <= 1.0 then: {
self.
} else: {
(self - 1.0) fibonacci + (self - 2.0) fibonacci.
}
}
}.
use Fibonacci-Float-Perspective in {
Console write-line!: "Fib 20: ", 20.0 fibonacci as-text
}