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
The SET APIs in the c target are being updated and this is a good opportunity to update their names as well.
Since the visibility of the SET APIs are limited to the body of a reaction and are C macros, the user cannot use anything with the same name as the SET APIs inside a reaction.
There are currently 3 alternatives that is decided between:
i. Use uppercase (ex. SET, SET_ARRAY, SET_TOKEN)
Pros: this is the naming scheme currently used.
Cons: SET is a less common name than set, but still quite common.
ii. Use lowercase (ex. set, set_array, set_token)
Pros: easiest to type.
Cons: set is a common name in C. So this limits the user from using anything named set in the body of a reaction.
iii. Use lf_ prepended (ex. lf_set, lf_set_array, lf_set_token)
Pros: least likely to have name conflicts. Align well with the conventional naming style in C.
Cons: names are more verbose compared to (i) and (ii).
If we prefix SET APIs with lf_, we also want to prefix schedule functions with lf_
Please cast your vote below! If you have other naming recommendations, feel free to add them too.
Additional Suggestions that came up during LF Meeting (2022-04-20):
keep uppercase SET but still limit scope to body of reaction.
make the naming of SET APIs configurable as a target property.
If we change the SET APIs naming, we could add a target property like legacy-support and include files to support older versions of APIs. Include that file in 0.2.0 by default and not by default in 0.3.0
Action Items:
come up with a list of other APIs to rename:
get_physical_time and the like
schedule and the like
How should we name the `SET` APIs?
i. Use uppercase (ex. `SET`, `SET_ARRAY`, `SET_TOKEN`)
0%
ii. Use lowercase (ex. `set`, `set_array`, `set_token`)
0%
iii. Use `lf_` prepended (ex. `lf_set`, `lf_set_array`, `lf_set_token`)
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
related issues / PRs:
reactor-c #68
lingua-franca #1097
lingua-franca #1103
The
SETAPIs in the c target are being updated and this is a good opportunity to update their names as well.Since the visibility of the
SETAPIs are limited to the body of a reaction and are C macros, the user cannot use anything with the same name as theSETAPIs inside a reaction.There are currently 3 alternatives that is decided between:
i. Use uppercase (ex.
SET,SET_ARRAY,SET_TOKEN)Pros: this is the naming scheme currently used.
Cons:
SETis a less common name thanset, but still quite common.ii. Use lowercase (ex.
set,set_array,set_token)Pros: easiest to type.
Cons:
setis a common name in C. So this limits the user from using anything namedsetin the body of a reaction.iii. Use
lf_prepended (ex.lf_set,lf_set_array,lf_set_token)Pros: least likely to have name conflicts. Align well with the conventional naming style in C.
Cons: names are more verbose compared to (i) and (ii).
If we prefix
SETAPIs withlf_, we also want to prefix schedule functions withlf_Please cast your vote below! If you have other naming recommendations, feel free to add them too.
Additional Suggestions that came up during LF Meeting (2022-04-20):
SETbut still limit scope to body of reaction.SETAPIs configurable as a target property.SETAPIs naming, we could add a target property likelegacy-supportand include files to support older versions of APIs. Include that file in0.2.0by default and not by default in0.3.0Action Items:
get_physical_timeand the likescheduleand the like3 votes ·
Beta Was this translation helpful? Give feedback.
All reactions