Re: Unsecure assoc calls

2009-09-20 Thread Carl Sorensen
Hi Michael, Thanks for your work on this. I think this is excellent architectural support for the future. On 9/20/09 2:11 PM, "Michael Käppler" wrote: > I think what now should be done is to check all assoc-get calls whether > they should use strict_checking or not. > In some cases this can b

Re: Unsecure assoc calls

2009-09-20 Thread Michael Käppler
Hi Neil, thanks for reviewing and applying. I think what now should be done is to check all assoc-get calls whether they should use strict_checking or not. In some cases this can be quite difficult IMHO and it's a far more time-consuming task than what I've done. Maybe Mark can do this? I think

Re: Unsecure assoc calls

2009-09-18 Thread Neil Puttock
2009/9/18 Michael Käppler : > Hmm... I forgot that ly:assoc-get throws an assert error instead of > returning #f if it's list argument isn't a list. I reverted this for now, > but maybe we should better output a programming error in assoc-get for this > case? I don't think that's necessary, since

Re: Unsecure assoc calls

2009-09-18 Thread Michael Käppler
Hi Neil, Hmm, some of these don't look too secure. :) Whoops... (let* ((table (ly:output-def-lookup layout 'label-page-table)) - (label-page (and (list? table) (assoc label table))) - (page-number (and label-page (cdr label-page))) +

Re: Unsecure assoc calls

2009-09-17 Thread Neil Puttock
2009/9/17 Michael Käppler : > that's nice. Here's the next step. Hmm, some of these don't look too secure. :) (let* ((table (ly:output-def-lookup layout 'label-page-table)) - (label-page (and (list? table) (assoc label table))) - (page-nu

Re: Unsecure assoc calls

2009-09-17 Thread Michael Käppler
Hi Neil, Thanks, also applied (no regtest problems to report). that's nice. Here's the next step. Btw. what's going on with the paper-margins patch? Could you run another regtest / doc build? Regards, Michael >From 7e0190ccc76f602d1e803f15832af780d449d863 Mon Sep 17 00:00:00 2001 From: =?

Re: Unsecure assoc calls

2009-09-16 Thread Neil Puttock
2009/9/13 Michael Käppler : > Great. The next step is attached. Can you please run a regtest? Thanks, also applied (no regtest problems to report). Regards, Neil ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/list

Re: Unsecure assoc calls

2009-09-13 Thread Michael Käppler
Hi Neil, Thanks, it's applied. Great. The next step is attached. Can you please run a regtest? Regards, Michael >From 2aa0ede53ec2b8e03f47c3b0f525cfbc636c Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Michael=20K=C3=A4ppler?= Date: Sun, 13 Sep 2009 22:11:36 +0200 Subject: [PATCH] Turn assoc

Re: Unsecure assoc calls

2009-09-13 Thread Neil Puttock
2009/9/13 Michael Käppler : > That should be fixed now. Thanks, it's applied. > Is there a default for maximum line length? I tend to follow Carl's suggestion for 80 columns, but as John's pointed out, sometimes it's awkward to keep within this limit. Regards, Neil __

Re: Unsecure assoc calls

2009-09-13 Thread John Mandereau
Le dimanche 13 septembre 2009 à 06:45 -0600, Carl Sorensen a écrit : > 80 characters maximum; I generally try to keep the lines about 70 > characters. FWIW in Python code it's often hard to keep lines below 80 characters, so I try to keep them around 80 characters and require them to be less than

Re: Unsecure assoc calls

2009-09-13 Thread Carl Sorensen
On 9/13/09 4:41 AM, "Michael Käppler" wrote: > > >> Sorry, silly me. :) >> >> I think we're nearly there. I'm just about to do a regtest check just >> to be sure. >> >> Just a few remaining nitpicks: >> >> - trailing spaces >> - long lines >> > That should be fixed now. > Is there a de

Re: Unsecure assoc calls

2009-09-13 Thread Michael Käppler
Sorry, silly me. :) I think we're nearly there. I'm just about to do a regtest check just to be sure. Just a few remaining nitpicks: - trailing spaces - long lines That should be fixed now. Is there a default for maximum line length? Regards, Michael >From baaffd7f66ef05e6adb9562272b480

Re: Unsecure assoc calls

2009-09-12 Thread Neil Puttock
The regtests completed without a hitch. Regards, Neil test-results.tar.gz Description: GNU Zip compressed data ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel

Re: Unsecure assoc calls

2009-09-12 Thread Neil Puttock
2009/9/12 Michael Käppler : > Are you sure? I tried this and IIRC it failed to compile. If I read the > guile manual correctly, it is only in Scheme optional, but not in C. Sorry, silly me. :) I think we're nearly there. I'm just about to do a regtest check just to be sure. Just a few remainin

Re: Unsecure assoc calls

2009-09-12 Thread Michael Käppler
Here's the next revision. + 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. Are you sure? I tried this and IIRC it failed to compile. If I read the guile manual correctly, it is

Re: Unsecure assoc calls

2009-09-12 Thread Neil Puttock
2009/9/12 Michael Käppler : > 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 underscor

Re: Unsecure assoc calls

2009-09-12 Thread Michael Käppler
Many thanks for all helpful comments. Attached is the revised patch. What's the reason that chain-assoc-get is defined separately in lily-library.scm:210, though ly_chain_assoc_get exists? Regards, Michael >From 740bd0fcb035099086e9e60a325019fdf25595d4 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?

Re: Unsecure assoc calls

2009-09-11 Thread Carl Sorensen
On 9/11/09 6:27 PM, "Michael Käppler" wrote: > > >> You need to amend the definition of the method in lily-guile.hh, since >> it's also used directly in the C++ code, with no optional arguments: >> >> 53 SCM ly_assoc_get (SCM key, SCM alist, SCM def); Can't you just use SCM ly_assoc_ge

Re: Unsecure assoc calls

2009-09-11 Thread Michael Käppler
You need to amend the definition of the method in lily-guile.hh, since it's also used directly in the C++ code, with no optional arguments: 53 SCM ly_assoc_get (SCM key, SCM alist, SCM def); Hmm... I don't exactly understand the LY_DEFINE macro. Is it possible to implement this with overloa

Re: Unsecure assoc calls

2009-09-11 Thread Ian Hulin
Hi Michael, Just one nit-pick: in the error message "outputted" -> "output". Cheers, Ian ___ lilypond-devel mailing list lilypond-devel@gnu.org http://lists.gnu.org/mailman/listinfo/lilypond-devel

Re: Unsecure assoc calls

2009-09-11 Thread Neil Puttock
2009/9/11 Michael Käppler : > Attached is the revised version. Okay to apply? There are a few problems with this: You need to amend the definition of the method in lily-guile.hh, since it's also used directly in the C++ code, with no optional arguments: 53 SCM ly_assoc_get (SCM key, SCM alist,

Re: Unsecure assoc calls

2009-09-11 Thread Michael Käppler
Hi Carl, LY_DEFINE (ly_assoc_get, "ly:assoc-get", 2, 1, 0, This line is wrong; you need to have the total of these three numbers be the total number of arguments. Yes, I forgot to adjust this. If you change this to 2, 2, 0, then strict-checking will be an optional argument,

Re: Unsecure assoc calls (was: Make default margin values depend on paper size)

2009-09-11 Thread Carl Sorensen
On 9/11/09 3:52 AM, "Michael Käppler" wrote: > Hi Carl, > (was it your intention to discuss this off-list? I ask because you > didn't cc the list for the last two times.) No, I made a mistake the first time, and the second time I replied all to your email that replied to mine. >> Hmmm -- I s

Unsecure assoc calls (was: Make default margin values depend on paper size)

2009-09-11 Thread Michael Käppler
Hi Carl, (was it your intention to discuss this off-list? I ask because you didn't cc the list for the last two times.) Hmmm -- I see your point. Without looking into the code for each of those grep results, I couldn't answer. But assoc-get is defined in LilyPond, and was certainly recommended