|
825 | 825 | (let $type' (if (== $type %Undefined%) (undefined-doc-function-type $params) (cdr-atom $type)) |
826 | 826 | (let ($params' $ret') (get-doc-params $params $ret $type') |
827 | 827 | (@doc-formal (@item $name) (@kind function) (@type $type) $desc (@params $params') $ret'))) |
828 | | - (@doc-formal (@item $name) (@kind function) (@type $type) (@desc "No documentation")) )) |
| 828 | + Empty )) |
829 | 829 |
|
830 | 830 | (@doc undefined-doc-function-type |
831 | 831 | (@desc "Function used by get-doc-single-atom in case of absence of function's type notation") |
|
872 | 872 | (@doc-formal (@item $atom) (@kind atom) (@type $type) $desc) |
873 | 873 | (unify $space (@doc $atom $desc' (@params $params) $ret) |
874 | 874 | (get-doc-function $space $atom %Undefined%) |
875 | | - (@doc-formal (@item $atom) (@kind atom) (@type $type) (@desc "No documentation")) )))) |
| 875 | + Empty )))) |
876 | 876 |
|
877 | 877 | (@doc help! |
878 | 878 | (@desc "Function prints documentation for the input atom or module. Without parameters prints the list of the corelib functions.") |
|
881 | 881 | (@return "Unit atom")) |
882 | 882 | (: help! (-> Atom (->))) |
883 | 883 | (= (help! $atom) |
| 884 | + (case (help-internal! $atom) ( |
| 885 | + (Empty (println! (format-args "No documentation found for {}" ($atom)))) |
| 886 | + ($other $other) ))) |
| 887 | + |
| 888 | +(: help! (-> (->))) |
| 889 | +(= (help!) (help! corelib)) |
| 890 | + |
| 891 | +(: help-internal! (-> Atom (->))) |
| 892 | +(= (help-internal! $atom) |
884 | 893 | (let $top-space (mod-space! top) |
885 | 894 | (case (get-doc $top-space $atom) ( |
886 | 895 | ((@doc-formal (@item $item) (@kind function) (@type $type) (@desc $descr) |
|
897 | 906 | ((@doc-formal (@item $item) (@kind atom) (@type $type) (@desc $descr)) |
898 | 907 | (let () (println! (format-args "Atom {}: {} {}" ($item $type $descr))) |
899 | 908 | () )) |
| 909 | + (Empty Empty) |
900 | 910 | ($other (Error $other "Cannot match @doc-formal structure") ))))) |
901 | 911 |
|
902 | | -(: help! (-> Symbol (->))) |
903 | | -(= (help! $mod) |
904 | | - (let $space (module-space-no-deps (mod-space! $mod)) |
905 | | - (help-space! $space) )) |
906 | | - |
907 | | -(: help! (-> (->))) |
908 | | -(= (help!) (help! corelib)) |
| 912 | +(: help-internal! (-> Symbol (->))) |
| 913 | +(= (help-internal! $mod) |
| 914 | + (case (module-space-no-deps (mod-space! $mod)) ( |
| 915 | + ((Error $atom $msg) Empty) ; return Empty because other instance returns () |
| 916 | + ($space (help-space! $space)) ))) |
909 | 917 |
|
910 | 918 | (@doc help-space! |
911 | 919 | (@desc "Function prints documentation for all of the atoms from the given space.") |
|
914 | 922 | (@return "Unit atom")) |
915 | 923 | (: help-space! (-> SpaceType (->))) |
916 | 924 | (= (help-space! $space) |
917 | | - (unify $space (@doc $name (@desc $desc) $params $ret) |
918 | | - (let () (println! (format-args "{}\n\t{}" ($name $desc))) Empty) |
919 | | - Empty)) |
| 925 | + (let $_ (collapse |
| 926 | + (unify $space (@doc $name (@desc $desc) $params $ret) |
| 927 | + (let () (println! (format-args "{}\n\t{}" ($name $desc))) Empty) |
| 928 | + Empty )) ())) |
920 | 929 | (= (help-space! $space) |
921 | | - (unify $space (@doc $name (@desc $desc)) |
922 | | - (let () (println! (format-args "{}\n\t{}" ($name $desc))) Empty) |
923 | | - Empty)) |
| 930 | + (let $_ (collapse |
| 931 | + (unify $space (@doc $name (@desc $desc)) |
| 932 | + (let () (println! (format-args "{}\n\t{}" ($name $desc))) Empty) |
| 933 | + Empty )) Empty)) ; return Empty because other instance returns () |
924 | 934 |
|
925 | 935 | (@doc help-param! |
926 | 936 | (@desc "Function used by function help! to output parameters using println!") |
|
0 commit comments