[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Clean up embedded scheme parsing/evaluation. (issue 577410045 by add
From: |
hanwenn |
Subject: |
Re: Clean up embedded scheme parsing/evaluation. (issue 577410045 by address@hidden) |
Date: |
Tue, 28 Jan 2020 14:06:32 -0800 |
https://codereview.appspot.com/577410045/diff/571430047/lily/include/parse-scm.hh
File lily/include/parse-scm.hh (right):
https://codereview.appspot.com/577410045/diff/571430047/lily/include/parse-scm.hh#newcode30
lily/include/parse-scm.hh:30: SCM parse_embedded_scheme (Input *i, bool
safe, Lily_parser *parser);
On 2020/01/27 13:39:31, Dan Eble wrote:
> Changing Input& to Input* is more than cosmetic. Input& requires an
object, but
> Input* admits a nullptr. I'm concerned that I don't see that any
checks have
> been added before the pointer is dereferenced.
This code stores a reference, which is completely out of style in
LilyPond.
In general, pointers are preferred in function signatures, so you can
see that the value is mutated in the call site. See also
https://google.github.io/styleguide/cppguide.html#Reference_Arguments
What would we do in a check? Passing a null input is a programming
error; if we don't check, we'll generate a segfault and that seems
appropriate for a programming error.
https://codereview.appspot.com/577410045/
- Clean up embedded scheme parsing/evaluation. (issue 577410045 by address@hidden), hanwenn, 2020/01/27
- Re: Clean up embedded scheme parsing/evaluation. (issue 577410045 by address@hidden), nine . fierce . ballads, 2020/01/27
- Re: Clean up embedded scheme parsing/evaluation. (issue 577410045 by address@hidden),
hanwenn <=
- Re: Clean up embedded scheme parsing/evaluation. (issue 577410045 by address@hidden), dak, 2020/01/28
- Re: Clean up embedded scheme parsing/evaluation. (issue 577410045 by address@hidden), nine . fierce . ballads, 2020/01/28
- Re: Clean up embedded scheme parsing/evaluation. (issue 577410045 by address@hidden), hanwenn, 2020/01/29
- Re: Clean up embedded scheme parsing/evaluation. (issue 577410045 by address@hidden), dak, 2020/01/29
- Re: Clean up embedded scheme parsing/evaluation. (issue 577410045 by address@hidden), dak, 2020/01/29
- Re: Clean up embedded scheme parsing/evaluation. (issue 577410045 by address@hidden), hanwenn, 2020/01/30
- Re: Clean up embedded scheme parsing/evaluation. (issue 577410045 by address@hidden), hanwenn, 2020/01/30
- Re: Clean up embedded scheme parsing/evaluation. (issue 577410045 by address@hidden), dak, 2020/01/30
- Re: Clean up embedded scheme parsing/evaluation. (issue 577410045 by address@hidden), hanwenn, 2020/01/30