Minor thing but wondering if someone can suggest a better syntax to extend an existing object using a splat, but without using curly braces? My main purpose is to keep indented style while passing the extended object to a function. This has the correct behavior:
base-obj =
old-prop: \value
do-something {
...base-obj
extended-prop: \value
}
But can the curly braces be eliminated somehow? 'Do' doesn't work:
old-obj =
old-prop: \value
do-something do
...old-obj
new-prop: \value
# do-something will only see new-prop
I found <<< which will get the job done but in a somewhat roundabout way:
Update: modified to prevent side-effect change to base-obj, based on @homam's suggestion.