tzlaine / parser

A C++ parser combinator library.
Boost Software License 1.0
81 stars 12 forks source link

undefined `str` in the description of `parse` #31

Closed akrzemi1 closed 9 months ago

akrzemi1 commented 9 months ago

In this part of reference: https://tzlaine.github.io/parser/doc/html/boost/parser/parse_idm20259.html

The description uses term "Parses str", whereas the corresponding parameter is called r.

The wider issue is that when one looks at the synopsis in https://tzlaine.github.io/parser/doc/html/header/boost/parser/parser_hpp.html, the name R doesnt give much hint about what the parameter is. Maybe call it input or text?

tzlaine commented 9 months ago

R has become the standard way to call the range passed to an algorithm, as of C++20. I use it all over the place in my code as well. I think this is fine. I don't think people will be confused by the name. However, I did fix the str/r confusion -- thanks for pointing that out.

akrzemi1 commented 9 months ago

R has become the standard way to call the range passed to an algorithm

Well, maybe you mean "has become the standard in some circles, like WG21"? I must say I wasn't familiar with that pattern. I am used to have identifiers actually reflecting what they represent in the declarations.

tzlaine commented 9 months ago

WG21 sure, but also the bible that the whole community collectively uses:

https://en.cppreference.com/w/cpp/algorithm/ranges/sort