Skip to content

Add corecursion #6

@rahulc29

Description

@rahulc29

Currently the language supports recursion as a first-class construct using the fix form.
It might be fun to try to add corecursion as well so that something like the corecursive definition of Fibonacci can be given.

metaFibs x y = x :: metaFibs y (x + y)
fibs = metaFibs 0 1

Possible concrete syntax :

(defcorec (meta-fibs x y) 
   (cons x (meta-fibs y (+ x y))))
(defval fibs (meta-fibs 0 1))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions