Commit Graph

7 Commits

Author SHA1 Message Date
Qi Xiao
96752afa4d Make struct maps indistinguishable from maps to Elvish code.
Struct map is a mechanism to let Go code expose simple structs to Elvish code.
The difference between struct maps and maps is convenience for Go code; they
also have different performance characteristics, but since struct maps are
always quite small, the difference is not meaningful for Elvish's use cases.

As a result, there is no good reason that Elvish code needs to be aware of the
difference between struct maps and normal maps. Making them indistinguishable to
Elvish code simplifies the language.

This commit does the following:

- Change Equal, Hash, Kind and Repr to treat struct maps like maps.

- Change Assoc and Dissoc to "promote" struct maps to maps.

- Remove the custom Repr method of parse.Source.

- Update documentation to reflect this change.
2023-07-14 23:57:38 +01:00
Qi Xiao
08007a52ce website/cmd/md2html: Support implicit link targets to elvdoc sections.
For example, [`put`]() links to the elvdoc for "put".

Also remove the @cf macro now that implicit targets make it easier to link to
other elvdoc sections.
2023-01-02 02:36:58 +00:00
Qi Xiao
fcc6d23f14 pkg/mods/doc: Convert links to language.html to absolute links.
For example, a link to language.html#number is converted to point to
https://elv.sh/ref/language.html#number instead. Such links are quite common in
elvdocs.

Also convert all link destinations that use ./language.html to use language.html
instead, and add a check in tools/check-disallowed.sh to ensure that remains the
case.
2023-01-02 01:35:41 +00:00
Qi Xiao
629be7e297 Use path:is-dir in the example for $pwd. 2022-12-30 18:36:31 +00:00
Qi Xiao
7c52dd9545 Fix the example for $pwd to use new temporary assignment syntax. 2022-12-30 18:30:47 +00:00
Qi Xiao
980cf009ca Parse comment blocks preceding var and fn declarations as doc comments.
Convert all .elv files (including .d.elv files) to use this new format.
2022-11-22 22:59:31 +00:00
Qi Xiao
a3f4384495 Move all elvdocs into .d.elv files.
The elvdocs still use the old format (#elvdoc:fn or #elvdoc:var) for now, but
will be changed to "fn" and "var" forms soon.

Also remove the accidentally committed cmd/mvelvdoc. It has been used to perform
the conversion automatically but is not supposed to be committed.
2022-11-20 21:59:45 +00:00