3 ms·
Beautiful! How do you access a property on the result of a function call? On the other hand, that case is pretty rare. Maybe it’s worth ignoring.
by sillysaurusx 4y ago
Beautiful! How do you access a property on the result of a function call?
On the other hand, that case is pretty rare. Maybe it’s worth ignoring.
- soegaard 4y agoThat's a good question. The problem is that syntactically calling a method with no arguments and accessing a field will look the same, if .f is used to access a field: (foo .m1 arg1 .m) ; m is a method name (foo .m1 arg1 .f) ; f is a field name I guess, one could introduce `_f` for field access. Right now one can use `getattr` or one can bind the result of `(foo .m1 arg1)` to an indentifier `o.` and then use `o.f`.