ScenicFramework / scenic

Core Scenic library
Apache License 2.0
1.97k stars 137 forks source link

Allow assign to take a map #291

Closed amclain closed 2 years ago

amclain commented 2 years ago

Description

This PR allows assign to take a map of values, like Phoenix does.

Motivation and Context

When working on a Scenic project, we captured the entire scene.assigns and transformed a few values. We received an error when trying to assign this resulting map back to the scene, since scene.assigns gave us a map. We referenced Phoenix's behavior of assigns since that was motivation for bringing it into Scenic, and Phoenix does in fact allow both a keyword list or map as assigns. Therefore we thought we should allow for assigning a map in Scenic as well.

Happy to discuss if this either isn't desired or should be implemented differently.

Types of changes

Checklist