Skip to content

Thoughts on how to do documentation #2

@teodorlu

Description

@teodorlu

It would be neat if documentation could be stored semantically (as code) instead of as text inside comments. Here's what the Clojure equivalent could look like:

(defn mymap [f x]
  '(:doc "Apply f over x"
    :examples ((11 12 13) (map (fn [x] (+ x 10)) '(1 2 3))
               (11 21 31) (map inc '(10 20 30))))
  ;; Defer to Clojure
  (map f x))

Basic thought: If test cases are stored on the function, live coding could be really neat. In the process of editing the function? Just show its test cases live, highlighting any that fail.

Inspired by Live-py.

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