# PRE SIP: ThisFunction | scope injection (similar to kotlin receiver function)

**URL:** <https://contributors.scala-lang.org/t/pre-sip-thisfunction-scope-injection-similar-to-kotlin-receiver-function/2234>\
**Category:** Language Design\
**Created:** [August 30, 2018, 10:12am UTC](https://contributors.scala-lang.org/t/pre-sip-thisfunction-scope-injection-similar-to-kotlin-receiver-function/2234 "2018-08-30T10:12:44Z")\
**Posts on this page:** 1\
**Showing post:** 62

<div class="post-metadata">

**Author:** ![AMatveev](https://contributors.scala-lang.org/user_avatar/contributors.scala-lang.org/amatveev/32/847_2.png) [@AMatveev](https://contributors.scala-lang.org/u/AMatveev)\
**Post date:** [March 13, 2019, 9:11pm UTC](https://contributors.scala-lang.org/t/pre-sip-thisfunction-scope-injection-similar-to-kotlin-receiver-function/2234/62 "2019-03-13T21:11:03Z")

</div>

> [@drdozer](#):
>
> I’m unsure what the problem is that this addresses.

IIUC:

```auto
val myPage = 'html()(
  'head(),'div()("I wrote this page.")
)

```

It will be compiled correctly.

It is not problem for json, it is not big problem for html(Html has a very flexible structure).  
But for many dsl which have a lot of context dependent grammar.(sql,xml[with xsd],etc)  
Static type checking can highly improve usability.

> [@drdozer](#):
>
> Sorry to be _that_ annoying person, but

:))))  
Sorry, I will not prove you that

- static type cheking
- auto code completion

is a very good  
:))

If you are in the camp of dynamic schemes you just do not have such problems 😉

---

_[View the full topic](https://contributors.scala-lang.org/t/pre-sip-thisfunction-scope-injection-similar-to-kotlin-receiver-function/2234)._
