objectionary / news.eolang.org

Our Official Blog: we write about the development of EOLANG and 𝜑-calculus
https://news.eolang.org
MIT License
11 stars 5 forks source link

Blog post about syntax sugar `$` #44

Closed maxonfjvipon closed 12 months ago

maxonfjvipon commented 1 year ago

In EO we have $ object which is actually a syntax sugar and refer to current abstract object it's used in So the next code:

[] > foo
  assert-that > @
    2.plus 2
    $.equal-to 4

actually means:

[] > foo
  assert-that > @
    2.plus 2
    foo.equal-to 4 # foo.@.equal-to --> assert-that.equal-to

It would be nice to write a blog post about it

maxonfjvipon commented 12 months ago

@Graur well done! I'm closing it