cakelisp icon indicating copy to clipboard operation
cakelisp copied to clipboard

Added "access" to use the arrow operator.

Open ThatCreeper opened this issue 3 years ago • 3 comments

I get that (*a).b and a->b are the same, but the second one just feels better to me.

This PR adds in a access function that works the same as field except it uses an arrow instead of a period.

Please tell me if you feel that this should be renamed, but also feel free to not merge this PR.

ThatCreeper avatar Jul 23 '22 06:07 ThatCreeper

Hi, thanks for taking the time to put this together!

The path generator is meant to be used for pointers, and mixed paths: (path a > b) Or: (path a > b . c), where c is a field of b.

makuto avatar Jul 27 '22 03:07 makuto

It might still be convenient to have access for single/nested pointer accesses, but I don't know if it should be a generator or a macro in "user space" that outputs path for you.

makuto avatar Jul 27 '22 03:07 makuto

Hi, thanks for looking over this PR.

I missed path when I was searching for a way to do that, thanks for letting me know.

I'm going to leave this PR open because of your last comment, but feel free to close it.

Thank you.

ThatCreeper avatar Jul 27 '22 06:07 ThatCreeper

I improved the documentation a bit to describe path.

makuto avatar Aug 18 '22 13:08 makuto