Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions spec/formatting.md
Original file line number Diff line number Diff line change
Expand Up @@ -216,9 +216,10 @@ the following steps are taken:
- If the _option_'s right-hand side successfully resolves to a value,
bind the _identifier_ of the _option_ to the resolved value in the mapping.
- Otherwise, bind the _identifier_ of the _option_ to an unresolved value in the mapping.
Implementations MAY later remove this value before calling the _function_.
(Note that an Unresolved Variable error will have been emitted.)
4. Remove from the resolved mapping of _options_ any binding for which the value is an unresolved value.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems reasonable, but perhaps we should explicitly allow implementations to remove the value later (to prevent the local equivalent of NPE):

Suggested change
4. Remove from the resolved mapping of _options_ any binding for which the value is an unresolved value.
Implementations MAY later remove this value before calling the _function_.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this suggestion, thanks @aphillips.

I think delegating the decision about whether to remove or not to implementations is the right choice. In some implementations it's going to be natural to use a sentinel value to represent unresolved option values; other implementations may not have such possibility and they can instead choose to completely remove unresolved options from the map before it's passed to the function.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wasn't able to apply this suggestion via GitHub's UI. I pushed 006e60d instead.

5. Call the function implementation with the following arguments:

4. Call the function implementation with the following arguments:

- The current _locale_.
- The resolved mapping of _options_.
Expand Down