Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(2883)

Issue 345190043: Dedicated functions for negative predicate tests (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
5 years, 2 months ago by Valentin Villenave
Modified:
5 years, 2 months ago
Reviewers:
dak, c_sorensen
CC:
lilypond-devel_gnu.org
Visibility:
Public.

Description

Dedicated functions for negative predicate tests Negative tests, e.g. (not (null? x)), are everywhere in Scheme functions. Having dedicated functions for the most common ones may allow to make the code a bit lighter (and possibly very slightly faster). This patch includes tests for not-null?, not-zero?, not-integer?, not-number?, not-symbol?, not-string? and not-list?, as well as a C++-defined not-pair? that may be used instead of the already-existing one found in srfi-1. (These are all available as ly:-prefixed functions as well, which may help in case something changes in upstream Guile.) It is, however, a rather substantial addition (turning some Scheme functions into somewhat of a non-standard dialect, even though the syntax remains self-evident), and is therefore open to discussion -- or outright rejection :-)

Patch Set 1 #

Patch Set 2 : Fix `make check’. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+237 lines, -153 lines) Patch
M lily/general-scheme.cc View 1 1 chunk +58 lines, -0 lines 0 comments Download
M ly/articulate.ly View 2 chunks +2 lines, -2 lines 0 comments Download
M ly/music-functions-init.ly View 1 chunk +1 line, -1 line 0 comments Download
M scm/auto-beam.scm View 2 chunks +2 lines, -2 lines 0 comments Download
M scm/backend-library.scm View 1 chunk +1 line, -1 line 0 comments Download
M scm/bar-line.scm View 3 chunks +3 lines, -3 lines 0 comments Download
M scm/chord-ignatzek-names.scm View 1 chunk +1 line, -1 line 0 comments Download
M scm/define-event-classes.scm View 1 chunk +1 line, -1 line 0 comments Download
M scm/define-markup-commands.scm View 4 chunks +5 lines, -5 lines 0 comments Download
M scm/define-music-display-methods.scm View 6 chunks +10 lines, -10 lines 0 comments Download
M scm/define-music-types.scm View 1 chunk +2 lines, -2 lines 0 comments Download
M scm/display-lily.scm View 1 chunk +1 line, -1 line 0 comments Download
M scm/document-translation.scm View 1 chunk +1 line, -1 line 0 comments Download
M scm/file-cache.scm View 1 chunk +1 line, -1 line 0 comments Download
M scm/flag-styles.scm View 1 chunk +1 line, -1 line 0 comments Download
M scm/fret-diagrams.scm View 11 chunks +15 lines, -15 lines 0 comments Download
M scm/graphviz.scm View 1 1 chunk +1 line, -1 line 0 comments Download
M scm/lily.scm View 2 chunks +2 lines, -2 lines 0 comments Download
M scm/lily-library.scm View 10 chunks +50 lines, -24 lines 0 comments Download
M scm/ly-syntax-constructors.scm View 1 chunk +1 line, -1 line 0 comments Download
M scm/markup.scm View 2 chunks +3 lines, -3 lines 0 comments Download
M scm/markup-macros.scm View 4 chunks +4 lines, -4 lines 0 comments Download
M scm/music-functions.scm View 6 chunks +9 lines, -9 lines 0 comments Download
M scm/output-lib.scm View 5 chunks +15 lines, -15 lines 0 comments Download
M scm/output-svg.scm View 3 chunks +5 lines, -5 lines 0 comments Download
M scm/page.scm View 2 chunks +2 lines, -2 lines 0 comments Download
M scm/paper-system.scm View 1 chunk +1 line, -1 line 0 comments Download
M scm/part-combiner.scm View 5 chunks +7 lines, -7 lines 0 comments Download
M scm/song.scm View 10 chunks +16 lines, -16 lines 0 comments Download
M scm/song-util.scm View 1 chunk +1 line, -1 line 0 comments Download
M scm/time-signature-settings.scm View 3 chunks +3 lines, -3 lines 0 comments Download
M scm/translation-functions.scm View 8 chunks +12 lines, -12 lines 0 comments Download

Messages

Total messages: 8
Valentin Villenave
Fix `make check’.
5 years, 2 months ago (2019-02-08 09:15:11 UTC) #1
Valentin Villenave
FWIW, here’s what `make test-clean; time make-test’ returns: Without the patch: real 10m5.239s user 17m3.656s ...
5 years, 2 months ago (2019-02-08 09:46:17 UTC) #2
dak
On 2019/02/08 09:46:17, Valentin Villenave wrote: > FWIW, here’s what `make test-clean; time make-test’ returns: ...
5 years, 2 months ago (2019-02-08 11:51:37 UTC) #3
Valentin Villenave
On 2019/02/08 11:51:37, dak wrote: > Frankly, I don't like it. The relevant metric here ...
5 years, 2 months ago (2019-02-08 12:45:43 UTC) #4
dak
On 2019/02/08 12:45:43, Valentin Villenave wrote: > On 2019/02/08 11:51:37, dak wrote: > > Frankly, ...
5 years, 2 months ago (2019-02-08 16:41:06 UTC) #5
Valentin Villenave
On 2019/02/08 16:41:06, dak wrote: > For what? For making some functions ever so slightly ...
5 years, 2 months ago (2019-02-08 17:05:46 UTC) #6
dak
On 2019/02/08 17:05:46, Valentin Villenave wrote: > On 2019/02/08 16:41:06, dak wrote: > > For ...
5 years, 2 months ago (2019-02-08 17:15:49 UTC) #7
c_sorensen
5 years, 2 months ago (2019-02-08 17:20:53 UTC) #8

On 2/8/19, 10:17 AM, "lilypond-devel on behalf of dak@gnu.org"
<lilypond-devel-bounces+c_sorensen=byu.edu@gnu.org on behalf of dak@gnu.org>
wrote:

    On 2019/02/08 17:05:46, Valentin Villenave wrote:
    > On 2019/02/08 16:41:06, dak wrote:
    > > For what?
    
    > Since you’re complaining about LilyPond-specific functions not handled
    by Guile,
    > what about assoc-get? From what I gather, this remains entirely bound
    to our
    > codebase?
    
    And I plan to at one time let it deal with more than just pairs in a
    list, also allowing hashtables as members (and likely tails) and likely
    vectors.
    
    So it's actually good if it is under our control.
    
Also, IIRC, assoc-get works to get values out of alist-chains, not just out of
plain alists.

Thanks,

Carl


Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b