Ejemplo n.º 1
0
def assign(name: Value, value: Value) -> Value:
    """
	Assigns `value` to `name`, where `name` must be an `Identifier`.

	Returns `value`.
	"""

    value = value.run()
    name.assign(value)
    return value
Ejemplo n.º 2
0
def assign(name: Value, value: Value) -> Value:
	"""
	Assigns `value` to `name`, converting `name` to an `Identifier` if
	it isn't already.

	Returns `value`.
	"""
	if not isinstance(name, Identifier):
		name = Identifier(str(name))

	value = value.run()
	name.assign(value)
	return value