~m15a/fnldoc#14: 
Extended doctest format

Current doctest simply runs Fennel code in docstring code fences. It may look like this:

(assert (= :return (fun ...)))

I feel this noisy for reading documentation since in almost every code fences (assert (= ... appears.

#Proposed extension

(fun ...) ;=> :return

or

(long-fun
  ...
  ...
  ...)
;=> :return

(NOTE: pseudo code)

translates to

(assert (= :return (fun ...)))

or

(assert (= :return (long-fun ... ... ...)))

and run doctesting.

Moreover, I think we can use Faith here implicitly, so that we can use faith.= for table comparison:

(fun ...) ;=> [:a :b :c]

translates to

(local t (require :faith))
(t.= [:a :b :c] (fun ...)))
Status
REPORTED
Submitter
~m15a
Assigned to
No-one
Submitted
1 year, 3 months ago
Updated
1 year, 3 months ago
Labels
change! doctest feat