-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rename and re-organize primitive operators
Primitive operators haven't got much love, as opposed to user-facing interfaces like the stdlib, and they have grown organically since the beginning of the very first Nickel prototype. As a result, the naming is inconsistent, with several generations, both in the surface syntax of Nickel and internally in the Rust codebase. This PR makes a cleaning pass on primitive operators, by: 1. Use full worlds in the style of the current stdlib: `str` -> `string`, `num` -> `number`, etc. 2. Introduce pseudo-namespaces: instead of `str_foo` and `record_bar`, we use `/` as a separator for categories. The previous examples become `string/foo` and `record/bar`. We don't use `.`, to make it clear that it's not a normal record access, but just a nice way to dinstinguish the different categories 3. Align old operators on the current naming in the standard library.
- Loading branch information
Showing
53 changed files
with
1,092 additions
and
1,082 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
cli/tests/snapshot/inputs/errors/record_forall_constraints_contract.ncl
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# capture = 'stderr' | ||
# command = ['eval'] | ||
let f | forall r. { ; r } -> { x: Number; r } = fun r => %record_insert% "x" r 1 in f { x = 0 } | ||
let f | forall r. { ; r } -> { x: Number; r } = fun r => %record/insert% "x" r 1 in f { x = 0 } |
2 changes: 1 addition & 1 deletion
2
cli/tests/snapshot/inputs/errors/record_forall_constraints_typecheck.ncl
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
# capture = 'stderr' | ||
# command = ['eval'] | ||
let f | forall r. { ; r } -> { x: Number; r } = fun r => %record_insert% "x" r 1 in (f { x = 0 } : _) | ||
let f | forall r. { ; r } -> { x: Number; r } = fun r => %record/insert% "x" r 1 in (f { x = 0 } : _) |
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
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
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
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
Oops, something went wrong.