# Inroduce - "...." or "from" - keyword, for call chain inference

**URL:** <https://es.discourse.group/t/inroduce-or-from-keyword-for-call-chain-inference/1111>\
**Category:** 💡 Ideas\
**Tags:** proposal\
**Created:** [December 2, 2021, 3:48am UTC](https://es.discourse.group/t/inroduce-or-from-keyword-for-call-chain-inference/1111 "2021-12-02T03:48:19Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Seagat2011](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/seagat2011/32/367_2.png) [@Seagat2011](https://es.discourse.group/u/Seagat2011)\
**Post date:** [December 2, 2021, 3:48am UTC](https://es.discourse.group/t/inroduce-or-from-keyword-for-call-chain-inference/1111/1 "2021-12-02T03:48:19Z")

</div>

```javascript
// If I know Color is a property - not sure where, 
// somewhere up the call chain, why not introduce 
// a keyword which infers it

let RGB = {
    Color: "red",
}
let ColorTint = {
    Color:RGB,
}
let Seed = {
    ColorSpace:ColorTint,
}
let Apple = {
    Seed: Seed,
}

let AppleTree = {
    Fruit: Apple,
}

let color = Color from Apple in AppleTree // AppleTree.Apple.Seed.ColorSpace.ColorTint.Color //

```

---

<div class="post-metadata">

**Author:** ![ljharb](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/ljharb/32/8_2.png) [@ljharb](https://es.discourse.group/u/ljharb)\
**Post date:** [December 2, 2021, 4:24am UTC](https://es.discourse.group/t/inroduce-or-from-keyword-for-call-chain-inference/1111/2 "2021-12-02T04:24:16Z")

</div>

“why not” may not be as important a first question as “why”?

Your proposed syntax is very confusing to me; as a reader (the far, far more important audience than the writer) i have absolutely no idea what’s happening here. What problem is this solving, besides saving a few characters?

---

<div class="post-metadata">

**Author:** ![theScottyJam](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/thescottyjam/32/616_2.png) [@theScottyJam](https://es.discourse.group/u/theScottyJam)\
**Post date:** [December 2, 2021, 2:35pm UTC](https://es.discourse.group/t/inroduce-or-from-keyword-for-call-chain-inference/1111/3 "2021-12-02T14:35:25Z")

</div>

The other solution to this problem would be to just have the API designer structure their objects to be less nested and more flat.

---

<div class="post-metadata">

**Author:** ![NickGard](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/nickgard/32/419_2.png) [@NickGard](https://es.discourse.group/u/NickGard)\
**Post date:** [December 4, 2021, 5:21am UTC](https://es.discourse.group/t/inroduce-or-from-keyword-for-call-chain-inference/1111/4 "2021-12-04T05:21:47Z")

</div>

In an ambiguous case, what value would be returned?

```javascript
let obj = {
  A: { target: 'this one' },
  B: { target: 'that one' }
};

console.log(target from obj); // what gets logged?

```

---

<div class="post-metadata">

**Author:** ![claudiameadows](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/claudiameadows/32/126_2.png) [@claudiameadows](https://es.discourse.group/u/claudiameadows)\
**Post date:** [December 12, 2021, 8:41am UTC](https://es.discourse.group/t/inroduce-or-from-keyword-for-call-chain-inference/1111/5 "2021-12-12T08:41:35Z")

</div>

You do realize the computational complexity in _finding_ that value, right? Also, I get `with` vibes out of this, particularly if you nested a `with` inside of a `with`.
