Stream: t-compiler/wg-rls-2.0

Topic: Naming for token-accessor functions


matklad (Apr 03 2020 at 19:16, on Zulip):

In ast, we have two kinds of "is this token present" funcitons: has_star(&self) -> bool and is_mutable(&self) -> bool.

Should we switch to the has_mut variant? (presumable with adding mut_token() accessors as well). It seems like "has token" fits better with pure-syntax style of API than "has property"

Luca Barbieri (Apr 03 2020 at 20:10, on Zulip):

I think the most elegant and general approach is to only have an accessor returning the token and calling is_some() on its result when a boolean is desired

Last update: Oct 28 2020 at 17:30UTC