Ernie Rael wrote:
> I like having the export with the function/data; good to know I'm
> looking at something that escapes into the wild.
>
> But I also like to know what contract the file has simply by looking at
> the top of the file.
>
> Allow an optional statement, for example `contract`, with only names and
> not definitions. If the contract statement exists then any/all names in
> the contract must be exported from the file, otherwise there's an error.
> In addition, if something is defined with export then it is an error if
> it does not appear in the contract, For example,
>
> vim9script
> contract f1, f2
> export def f1
> enddef
> export def f3
> enddef
>
> The above has two errors. f2 is in the contract, but not defined. f3 is
> exported, but is not in the contract.
>
> Note the word `export` could be re-used instead of adding a new keyword.
What language does it like this? Why only the names and not the type?
A name is not very useful without knowing what it is.
Generally I don't like this, because you have two places to change when
adding/removing/renaming items. You can just search for "export" to
find out what a script exports.
> (I am unable to file a feature request on github. Cockpit error or ???)
Might be a github hickup. My "git push" failed previously, now it's OK
again.
--
LAUNCELOT leaps into SHOT with a mighty cry and runs the GUARD through and
hacks him to the floor. Blood. Swashbuckling music (perhaps).
LAUNCELOT races through into the castle screaming.
SECOND SENTRY: Hey!
"Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// \\\
\\\ sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/20220322181337.12C121C22D1%40moolenaar.net.