# Confusion about bcom

**URL:** <https://community.spritely.institute/t/confusion-about-bcom/278>\
**Category:** Architecture\
**Tags:** ocaps\
**Created:** [July 3, 2023, 10:29am UTC](https://community.spritely.institute/t/confusion-about-bcom/278 "2023-07-03T10:29:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![vivi](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.spritely.institute/vivi/32/169_2.png) [@vivi](https://community.spritely.institute/u/vivi)\
**Post date:** [July 3, 2023, 10:29am UTC](https://community.spritely.institute/t/confusion-about-bcom/278/1 "2023-07-03T10:29:05Z")

</div>

I am running into some conceptual confusion about `bcom` that I wanted to document here as part of my process towards understanding Goblins.

It took me a while to realize that `bcom` can only be called at a tail position, as I eventually discovered a sentence mentioning it [here](https://spritely.institute/files/docs/guile-goblins/0.11.0/Object-construction.html). `bcom` also does not seem to work when made the tail of a promise callback. It would probably be helpful to have an error message if `bcom` is invoked in such an invalid situation.

It was helpful to use the second argument to `bcom` which I luckily also noticed on that page, but it was non-obvious and by default I expected to be able to call `bcom`, then return a value.

Is there any way to trigger the use of `bcom` after receving info from a promise callback? I am currently struggling with two objects which I want to both `bcom` something else, one triggered by the others’ change. Essentially, I want to ask the second object for some info, then `bcom` my second type of actor upon receiving the result in the callback. This seems like a simple operation so it is surprising to me how difficult it has been to conceptualize properly.

---

<div class="post-metadata">

**Author:** ![vivi](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.spritely.institute/vivi/32/169_2.png) [@vivi](https://community.spritely.institute/u/vivi)\
**Post date:** [July 3, 2023, 10:59am UTC](https://community.spritely.institute/t/confusion-about-bcom/278/2 "2023-07-03T10:59:20Z")

</div>

Stumbled upon this [Imperative bcom (with backwards compatiblility with functional api) (#53) · Issues · spritely / Goblins - Guile implementation · GitLab](https://gitlab.com/spritely/guile-goblins/-/issues/53) which seems to be discussing this stumbling block! Nice to know there’s some knowledge of it.

---

<div class="post-metadata">

**Author:** ![vivi](https://yyz2.discourse-cdn.com/flex030/user_avatar/community.spritely.institute/vivi/32/169_2.png) [@vivi](https://community.spritely.institute/u/vivi)\
**Post date:** [July 10, 2023, 12:32am UTC](https://community.spritely.institute/t/confusion-about-bcom/278/3 "2023-07-10T00:32:02Z")

</div>

I have, at least for this scenario, worked around the issue by having the second object send a second message to the first, to tell it to transition to the new state (and if it cannot do so, it returns a symbol `'connecting` to let the second object know something’s off). This way operations happen outside of promises and bcom can be used.
