You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Sys.systemName() returns a raw string for something that only has a set of specific / known values. This is quite error-prone, as can be seen here: #6921. It also means no code completion can be offered.
It would be nice to have a SystemName enum abstract instead that looks something like this:
This should preserve full backwards-compatbility due to @:forward and from String to String, while still also allowing the use of values not listed in the abstract.
The only open question is which values should actually be included in the enum... all that are known to be returned by at least one target? Just the most commonly supported ones?
HXCPP for instance has a few more obscure ones such as "EPPC".
@ncannassementioned there"s additional values for non-public console backends.
For the record, we have more exotic system names in some other not open source APIs (XBox, Switch, PS4 etc.)
Not sure if those would belong in a SystemName enum or not? Also, it seems a bit problematic consistency-wise if "XBox" is used, since the C# Target currently uses "Xbox" (lowercase b):
Sys.systemName()
returns a raw string for something that only has a set of specific / known values. This is quite error-prone, as can be seen here: #6921. It also means no code completion can be offered.It would be nice to have a
SystemName
enum abstract instead that looks something like this:This should preserve full backwards-compatbility due to
@:forward
andfrom String to String
, while still also allowing the use of values not listed in the abstract.The only open question is which values should actually be included in the enum... all that are known to be returned by at least one target? Just the most commonly supported ones?
HXCPP for instance has a few more obscure ones such as
"EPPC"
.https://github.com/HaxeFoundation/hxcpp/blob/56859a51a881660a1c38411a5128d11b5b299e31/project/libs/std/Sys.cpp#L236-L259
I"m also confused that there seems to be an
"Android"
, but no"iOS"
in hxcpp?HashLink does have
"iOS"
as well as"tvOS"
:https://github.com/HaxeFoundation/hashlink/blob/7268d1db6968631bcbb795b5cf4eb8a230db912d/src/std/sys.c#L116-L119
Lua has
"Solaris"
, which I haven"t seen anywhere else:haxe/std/lua/Boot.hx
Line 370 in 66d9121
@ncannasse mentioned there"s additional values for non-public console backends.
Not sure if those would belong in a
SystemName
enum or not? Also, it seems a bit problematic consistency-wise if"XBox"
is used, since the C# Target currently uses"Xbox"
(lowercaseb
):haxe/std/cs/_std/Sys.hx
Line 106 in 66d9121
The text was updated successfully, but these errors were encountered: