X-Git-Url: https://git.donarmstrong.com/?a=blobdiff_plain;f=lily%2Fprob-scheme.cc;h=119688e1570712696fc2a9746d0696366104fd96;hb=f8159a57125bbf52e96cad584d6c3756a39d5fc9;hp=717e32a945985358af74ee08f379b372e4363294;hpb=74599ededac15a341e2ee7641cde63b055a5d4e6;p=lilypond.git diff --git a/lily/prob-scheme.cc b/lily/prob-scheme.cc index 717e32a945..119688e157 100644 --- a/lily/prob-scheme.cc +++ b/lily/prob-scheme.cc @@ -1,9 +1,20 @@ /* - paper-system-scheme.cc -- implement Prob bindings + This file is part of LilyPond, the GNU music typesetter. - source file of the GNU LilyPond music typesetter + Copyright (C) 2005--2010 Han-Wen Nienhuys - (c) 2005--2007 Han-Wen Nienhuys + LilyPond is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + LilyPond is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with LilyPond. If not, see . */ #include "prob.hh" @@ -31,19 +42,21 @@ LY_DEFINE (ly_prob_property_p, "ly:prob-property?", } LY_DEFINE (ly_prob_property, "ly:prob-property", - 2, 1, 0, (SCM obj, SCM sym, SCM dfault), - "Return the value for @var{sym}.") + 2, 1, 0, (SCM prob, SCM sym, SCM val), + "Return the value for property @var{sym} of Prob object" + " @var{prob}. If no value is found, return @var{val} or" + " @code{'()} if @var{val} is not specified.") { - LY_ASSERT_SMOB (Prob, obj, 1); - Prob *ps = unsmob_prob (obj); + LY_ASSERT_SMOB (Prob, prob, 1); + Prob *ps = unsmob_prob (prob); LY_ASSERT_TYPE (ly_is_symbol, sym, 2); - if (dfault == SCM_UNDEFINED) - dfault = SCM_EOL; + if (val == SCM_UNDEFINED) + val = SCM_EOL; SCM retval = ps->internal_get_property (sym); if (retval == SCM_EOL) - return dfault; + return val; else return retval; }