Dominique wrote:

> > +                                                       *windowsversion()*
> > + windowsversion()
> > +               The result is a String.  For MS-Windows it indicates the OS
> > +               version.  E.g, Windows 10 is "10.0", Windows 8 is "6.2",
> > +               Windows XP is "5.1".  For non-MS-Windows systems the result 
> > is
> > +               an empty string.
> 
> Hard-coding the OS name in the function name seems
> inelegant and not flexible. What if we also need the version
> of macOs, etc.?
> 
> How about instead a more general function systeminfo()
> (any better name?) which returns a dictionary with keys for:
> 
> * os name  ("Windows", "GNU/Linux", "macOs", …)
> * os version  (a version number/string, specific to OS)
> * possibly other keys e.g. architecture: "x86", "x86_64", ...

It's possible to make it more generic, but it would then start out as
only implemented for MS-Windows.  And I have no idea when we would need
anything for other systems.  For Linux/Unix there usually is a way to
get info about the system with a shell command, e.g. with "uname".

Also, we already have has('unix'), has('mac'), etc.

-- 
A mathematician is a device for turning coffee into theorems.
                                        Paul Erdos
A computer programmer is a device for turning coffee into bugs.
                                        Bram Moolenaar

 /// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            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/201912271354.xBRDsF8l019406%40masaka.moolenaar.net.

Raspunde prin e-mail lui