-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
evaluator: Add map builtins has
and del
#45
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
firebase-deployment: https://evy-lang--45-68dhr1m4.web.app (20d51b5) |
juliaogris
force-pushed
the
map-builtins
branch
from
October 24, 2022 11:16
88445ce
to
53e72c9
Compare
camh-
reviewed
Oct 24, 2022
juliaogris
force-pushed
the
map-builtins
branch
5 times, most recently
from
October 26, 2022 00:41
ae9dd4d
to
ac882ff
Compare
Refactor map of no type from EMPTY_MAP to GENERIC_MAP and similarly refactor array of no type from EMPTY_ARRAY to GENERIC_ARRAY. We are currently using empty maps `{}` and arrays `[]` of no type as literals in expressions and assignments and give them a type in a deferred manner: e.g. [1 2] + [] makes the second array an array of num only when needed. We also now allow parameters to be of type GENERC_MAP or GENERIC_ARRAY, which can can only be used in builtin functions captured in the changes to the function `assertArgTypes` in parser.go In a follow up commit we are going to reuse this concept not only as literal for delayed type binding but also to mark a parameter type as "generic" map or array. This means a parameter hast to a be map, but it could be a map of any, num or other types. This will be useful for discovering invalid types for builtin functions `has` and `del` when the first parameter passed is not a map.
juliaogris
force-pushed
the
map-builtins
branch
from
October 26, 2022 00:47
ac882ff
to
787e331
Compare
Add builtin function `has` for entry existence check in map: has {a: 1} "a" // true
Add builtin function `del` for entry removal from map: del {a: 1} "a" // {}
juliaogris
force-pushed
the
map-builtins
branch
from
October 26, 2022 00:53
787e331
to
20d51b5
Compare
camh-
approved these changes
Oct 26, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🍏
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add builtin function
del
for entry removal from map:Add builtin function
has
for entry existence check in map: