[Feature request] Add . (dot) or other symbol(s) as variable reference in assignment block · Issue #180 · satyr/coco (original) (raw)
Currently we have this sugar: some.long.long.long.variable .= to-upper-case!
But we often have a lot of functions from some libs that takes var as argument and returns new value.
I suggest to add .
(dot) as variable reference in the assignment block:
some.long.long.long.variable = 'hello world!'
some-external-lib.sanitize = (s) -> s.replace /</?[^>]+>/g, ''
some.long.long.long.variable = some-external-lib.sanitize . .replace /\s+/g, '_' .to-upper-case!
And we can use some.long.long.long.variable = . .to-upper-case!
Maybe instead of dot use &.
or $&
(like in regex)
I think this will be very usable.