# SET-GROUP! Finds its Groove

**URL:** <https://revolt.metaeducation.com/forum/t/set-group-finds-its-groove/1663>\
**Category:** Datatypes\
**Created:** [August 15, 2021, 1:20am UTC](https://revolt.metaeducation.com/forum/t/set-group-finds-its-groove/1663 "2021-08-15T01:20:58Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![hostilefork](https://revolt.metaeducation.com/forum/user_avatar/revolt.metaeducation.com/hostilefork/32/421_2.png) [@hostilefork](https://revolt.metaeducation.com/forum/u/hostilefork)\
**Post date:** [August 15, 2021, 1:20am UTC](https://revolt.metaeducation.com/forum/t/set-group-finds-its-groove/1663/1 "2021-08-15T01:20:58Z")

</div>

Having seen the slick multi-return behavior for SET-BLOCK!, I wondered if there was a better purpose for SET-GROUP! than merely a synonym for SET.

```
(word): value
set word value

```

That felt a bit anticlimactic. You save one character, but you add three non-alphabetic symbols.

If these were equivalent, were we really getting the bang for the buck we would want out of a sparkly new datatype?

So I hesitated to declare that to be the meaning.

## But I've Found The Reason _Why_ It Needs To Be The Meaning...

**It fills the role of being a _SINGLE_ value, that can sit in literal slots to represent an assignment.**

That means you can say things like:

```
(var): default [10]

```

It's impossible for this to work with:

```
set var default [10]

```

Because it splits the intent to set the word pointed to by the variable into a function call to SET and a WORD! reference to VAR. _DEFAULT can only quote value left, and it has to pack up all the information it needs to do its job._

So it really is a missing piece. And really, I think there are a lot of cases where I'm just going to like **(word):** it better than **set word**. It may be a bit more symbolic, but by not being wordy it could blend in better.

```
var1: blah blah blah
var2: blah blah blah
(word): blah blah blah ; doesn't break the rhythm as much as SET WORD

```

## I'll Start Patching In Behaviors For It... The First Is UPARSE EMIT!

Right now, if you know the name you're going to emit for a variable, you can use it literally in GATHER:

```
>> uparse [10 20] [gather [emit x: integer!, emit y: integer!]]
== make object! [
    x: 10
    y: 20
]

```

But what if the field's name is dynamic (maybe even captured from the parsed material itself?) Well, SET-GROUP! seems the obvious answer, doesn't it?

```
>> word: 'xxx

>> uparse "a" [gather [emit (word): <any>]]
== make object! [
    xxx: #a
]

```
