|
875 | 875 | (@doc-formal (@item $atom) (@kind atom) (@type $type) (@desc "No documentation")) )))) |
876 | 876 |
|
877 | 877 | (@doc help! |
878 | | - (@desc "Function prints documentation for the input atom. Without parameters prints the list of the stdlib functions.") |
| 878 | + (@desc "Function prints documentation for the input atom or module. Without parameters prints the list of the corelib functions.") |
879 | 879 | (@params ( |
880 | | - (@param "Input to get documentation for"))) |
| 880 | + (@param "Input to get documentation for atom or module"))) |
881 | 881 | (@return "Unit atom")) |
882 | 882 | (: help! (-> Atom (->))) |
883 | 883 | (= (help! $atom) |
884 | | - (let $corelib-space (module-space-no-deps (mod-space! corelib)) |
885 | | - (case (get-doc $corelib-space $atom) ( |
| 884 | + (let $top-space (mod-space! top) |
| 885 | + (case (get-doc $top-space $atom) ( |
886 | 886 | ((@doc-formal (@item $item) (@kind function) (@type $type) (@desc $descr) |
887 | 887 | (@params $params) |
888 | 888 | (@return (@type $ret-type) (@desc $ret-desc))) |
|
899 | 899 | () )) |
900 | 900 | ($other (Error $other "Cannot match @doc-formal structure") ))))) |
901 | 901 |
|
| 902 | +(: help! (-> Symbol (->))) |
| 903 | +(= (help! $mod) |
| 904 | + (let $space (module-space-no-deps (mod-space! $mod)) |
| 905 | + (help-space! $space) )) |
| 906 | + |
902 | 907 | (: help! (-> (->))) |
903 | | -(= (help!) |
904 | | - (let $corelib-space (module-space-no-deps (mod-space! corelib)) |
905 | | - (unify $corelib-space (@doc $name (@desc $desc) $params $ret) |
| 908 | +(= (help!) (help! corelib)) |
| 909 | + |
| 910 | +(@doc help-space! |
| 911 | + (@desc "Function prints documentation for all of the atoms from the given space.") |
| 912 | + (@params ( |
| 913 | + (@param "Space to print documentation for"))) |
| 914 | + (@return "Unit atom")) |
| 915 | +(: help-space! (-> SpaceType (->))) |
| 916 | +(= (help-space! $space) |
| 917 | + (unify $space (@doc $name (@desc $desc) $params $ret) |
906 | 918 | (let () (println! (format-args "{}\n\t{}" ($name $desc))) Empty) |
907 | | - Empty))) |
908 | | -(= (help!) |
909 | | - (let $corelib-space (module-space-no-deps (mod-space! corelib)) |
910 | | - (unify $corelib-space (@doc $name (@desc $desc)) |
| 919 | + Empty)) |
| 920 | +(= (help-space! $space) |
| 921 | + (unify $space (@doc $name (@desc $desc)) |
911 | 922 | (let () (println! (format-args "{}\n\t{}" ($name $desc))) Empty) |
912 | | - Empty))) |
| 923 | + Empty)) |
913 | 924 |
|
914 | 925 | (@doc help-param! |
915 | 926 | (@desc "Function used by function help! to output parameters using println!") |
|
0 commit comments