https://kotlinlang.org logo
#http4k
Title
# http4k
d

dave

10/28/2019, 6:05 AM
For the first, this should definitely work. Could you just put together a tiny example and post it here or in a gist, and we'll take look?
r

Razi Kheir

10/28/2019, 6:14 AM
Yes
d

dave

10/28/2019, 7:24 AM
Congratulations - you've uncovered a bit of a bug in the Environment API! The good news is that there is a legit workaround whilst we fix it. 🙂 If you use
invoke()
to get the value from the environment eg.
val value = keyLens(env)
instead of
env[keyLens]
, it will work as intended. TBH, the Map-like
get()/set()
behaviour isn't actually documented anywhere as we expect people to always use
invoke()
with lenses, but I'd like to get it working.
r

Razi Kheir

10/29/2019, 2:26 AM
Ahhh thanks! Sorry for not giving the snippet, I’m trying to stay above water :x I promise one day I will contribute haha
d

dave

10/29/2019, 4:28 AM
Np. The fix has been released btw: 3.193.1
👍 1
2 Views