lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unsecure assoc calls


From: Neil Puttock
Subject: Re: Unsecure assoc calls
Date: Sat, 12 Sep 2009 21:38:05 +0100

2009/9/12 Michael Käppler <address@hidden>:
> Many thanks for all helpful comments.
> Attached is the revised patch.

+          "Return value if @var{key} in @var{alist}, else @var{default_value}"

@var{default-value}

The automagical docs generation makes the C++ variables more
Scheme-like by replacing underscores with hyphens, so the docstrings
should reflect this.

+          " (or @code{#f} if not specified). If @var{strict_checking} is set"

Two spaces after a full stop.

+      string key_string = ly_scm2string (scm_object_to_string (key,
SCM_UNDEFINED));

I think it's OK to leave out the print function argument, since it's optional.

+      programming_error (to_string ("Cannot find key `%s' in alist,
setting to `%s'.",
+                         key_string, default_value_string));

This will crash at runtime.

You'll have to do it something like this:

programming_error ("Cannot find key `" + key_string + "' in alist,
setting to `" + default_value_string + "'.");

> What's the reason that chain-assoc-get is defined separately in
> lily-library.scm:210, though ly_chain_assoc_get exists?

It looks like an honest mistake, since originally ly_assoc_get wasn't
exported to Scheme (chain-assoc-get predates this).

I don't see any harm in removing the code in lily-library.scm and
redefining chain-assoc-get in the same way as assoc-get.

Regards,
Neil




reply via email to

[Prev in Thread] Current Thread [Next in Thread]