From 686e65bae2d0659995dac27a5f393b545f42e6a0 Mon Sep 17 00:00:00 2001 From: Han-Wen Nienhuys Date: Sun, 22 Oct 2000 02:42:57 +0200 Subject: [PATCH] release: 1.3.97 ============ * Made small fixes to basic properties: regression-test compiles. * Moved Text_script_req's text_ member into mus-property. * Renamed ChordName to ChordNames, for consistancy. * Resurrected most of chord names, superscripting and kerning is currently broken, though. * Junked all old style text lookups, except for feta definitions. * Added support for name-based character lookups. * Added support for font styles and papersize style sheets. * Added new code for font selection and scm text markup. Only used for testing in \textscript SCM. See input/test/markup.ly. * Fixed (added actually, it got lost?) word-space for chords. * Added slope-limit and attachment-offset properties to slur. * Slur's broken trend now weighs in the number of note-columns. * Spacing tweaks 1.3.96.h --- CHANGES | 13 ++-- Documentation/index.texi | 1 + Documentation/user/GNUmakefile | 16 +++-- VERSION | 4 +- lily/GNUmakefile | 4 ++ lily/property-engraver.cc | 2 +- ly/textscripts.ly | 0 make/out/lilypond.lsm | 8 +-- make/out/lilypond.spec | 4 +- scm/element-descriptions.scm | 88 +++++++++++------------ scm/generate-documentation.scm | 124 +++++++++++++++++++++------------ scm/interface.scm | 25 +++++-- 12 files changed, 173 insertions(+), 116 deletions(-) delete mode 100644 ly/textscripts.ly diff --git a/CHANGES b/CHANGES index 51db323a62..8c6ace17ad 100644 --- a/CHANGES +++ b/CHANGES @@ -3,9 +3,6 @@ * Made small fixes to basic properties: regression-test compiles. -1.3.96.jcn9 -=========== - * Moved Text_script_req's text_ member into mus-property. * Renamed ChordName to ChordNames, for consistancy. @@ -13,9 +10,6 @@ * Resurrected most of chord names, superscripting and kerning is currently broken, though. -1.3.96.jcn7 -=========== - * Junked all old style text lookups, except for feta definitions. * Added support for name-based character lookups. @@ -31,7 +25,7 @@ * Slur's broken trend now weighs in the number of note-columns. -* Spacing tweaks: +* Spacing tweaks 1.3.96.hwn1 =========== @@ -43,8 +37,9 @@ * Solaris fix. * Type checking for \push and \pop; elt property description (docs -inclusive) is now in Scheme. Preliminary auto-documentation in -ly/generate-documentation.ly +inclusive) is now in Scheme. + +* Self-documenting backend using ly/generate-documentation.ly 1.3.95.jcn5 diff --git a/Documentation/index.texi b/Documentation/index.texi index 3b1f3e2258..6ed47693cf 100644 --- a/Documentation/index.texi +++ b/Documentation/index.texi @@ -22,6 +22,7 @@ @itemize @bullet @item @uref{../user/out-www/lilypond.html,LilyPond reference manual} also available in @uref{../user/out-www/lilypond.ps.gz,Postscript} +@item @uref{../user/out-www/backend.html,LilyPond backend reference} @item @uref{../user/out-www/glossary.html,A glossary of musical terms}, includes translations. Also available in @uref{../user/out-www/glossary.ps.gz,Postscript}) @item @uref{../user/out-www/mudela-book.html,mudela-book}, a tool for diff --git a/Documentation/user/GNUmakefile b/Documentation/user/GNUmakefile index 6b7186af4b..98e71f00e6 100644 --- a/Documentation/user/GNUmakefile +++ b/Documentation/user/GNUmakefile @@ -28,12 +28,14 @@ dvi: $(DVI_FILES) ps: $(PS_FILES) # urg -default: +default: -local-WWW: $(HTML_FILES) $(datafiles) $(PS_GZ_FILES) - $(PYTHON) $(step-bindir)/ls-latex.py --title 'User documentation' \ - $(DOC_FILES) $(TEX_FILES) $(TELY_FILES) \ - | sed "s!$(outdir)/!!g" > $(outdir)/index.html +local-WWW: $(HTML_FILES) $(datafiles) $(PS_GZ_FILES) backdoc + true + +# $(PYTHON) $(step-bindir)/ls-latex.py --title 'User documentation' \ +# $(DOC_FILES) $(TEX_FILES) $(TELY_FILES) \ +# | sed "s!$(outdir)/!!g" > $(outdir)/index.html $(outdir)/%.bib: %.bib ln -f $< $@ @@ -42,3 +44,7 @@ $(outdir)/%.bib: %.bib localclean: rm -f fonts.aux fonts.log feta*.tfm feta*.*pk + +#ugh. out/ hardcoded. +backdoc: + (cd $(outdir); $(topdir)/lily/out/lilypond $(depth)/../ly/generate-documentation) diff --git a/VERSION b/VERSION index b2a0012dcc..23c4d59326 100644 --- a/VERSION +++ b/VERSION @@ -1,8 +1,8 @@ PACKAGE_NAME=LilyPond MAJOR_VERSION=1 MINOR_VERSION=3 -PATCH_LEVEL=96 -MY_PATCH_LEVEL=jcn10 +PATCH_LEVEL=97 +MY_PATCH_LEVEL= # use the above to send patches: MY_PATCH_LEVEL is always empty for a # released version. diff --git a/lily/GNUmakefile b/lily/GNUmakefile index 254cf67f78..d81ea7813c 100644 --- a/lily/GNUmakefile +++ b/lily/GNUmakefile @@ -14,6 +14,10 @@ HELP2MAN_EXECS = lilypond STEPMAKE_TEMPLATES= c++ executable po help2man include $(depth)/make/stepmake.make + +default: + + # force these: Make can't know these have to be generated in advance $(outdir)/my-lily-parser.o: $(outdir)/parser.hh $(outdir)/my-lily-lexer.o: $(outdir)/parser.hh diff --git a/lily/property-engraver.cc b/lily/property-engraver.cc index 2b511ff261..67b48089a3 100644 --- a/lily/property-engraver.cc +++ b/lily/property-engraver.cc @@ -125,7 +125,7 @@ Property_engraver::apply_properties (SCM p, Score_element *e, Translator_group*o SCM name = e->get_elt_property ("meta"); name = scm_assoc (ly_symbol2scm ("name"), name); - scm_display (name, errport); + scm_display (gh_cdr(name), errport); scm_puts(" \\push #'",errport); scm_display (elt_prop_sym,errport); scm_puts ( " = #",errport); diff --git a/ly/textscripts.ly b/ly/textscripts.ly deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/make/out/lilypond.lsm b/make/out/lilypond.lsm index 2ce63ea474..c674df4239 100644 --- a/make/out/lilypond.lsm +++ b/make/out/lilypond.lsm @@ -1,15 +1,15 @@ Begin3 Title: LilyPond -Version: 1.3.96 -Entered-date: 13OKT00 +Version: 1.3.97 +Entered-date: 22OCT00 Description: Keywords: music notation typesetting midi fonts engraving Author: hanwen@cs.uu.nl (Han-Wen Nienhuys) janneke@gnu.org (Jan Nieuwenhuizen) Maintained-by: hanwen@stack.nl (Han-Wen Nienhuys) Primary-site: sunsite.unc.edu /pub/Linux/apps/sound/convert - 1000k lilypond-1.3.96.tar.gz + 1000k lilypond-1.3.97.tar.gz Original-site: ftp.cs.uu.nl /pub/GNU/LilyPond/development/ - 1000k lilypond-1.3.96.tar.gz + 1000k lilypond-1.3.97.tar.gz Copying-policy: GPL End diff --git a/make/out/lilypond.spec b/make/out/lilypond.spec index f1cbe8e9ba..8d1decf1a5 100644 --- a/make/out/lilypond.spec +++ b/make/out/lilypond.spec @@ -1,9 +1,9 @@ Name: lilypond -Version: 1.3.96 +Version: 1.3.97 Release: 1 License: GPL Group: Applications/Publishing -Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.96.tar.gz +Source0: ftp.cs.uu.nl:/pub/GNU/LilyPond/development/lilypond-1.3.97.tar.gz Summary: A program for printing sheet music. URL: http://www.cs.uu.nl/~hanwen/lilypond # Icon: lilypond-icon.gif diff --git a/scm/element-descriptions.scm b/scm/element-descriptions.scm index 504cdfc4cc..80613065f4 100644 --- a/scm/element-descriptions.scm +++ b/scm/element-descriptions.scm @@ -29,7 +29,7 @@ (thin-kern . 3.0) (hair-thickness . 1.6) (thick-thickness . 6.0) - (meta . ,(element-description "BarLine" bar-line-interface general-element-interface)) + (meta . ,(element-description "BarLine" bar-line-interface )) )) (BarNumber . ( @@ -43,7 +43,7 @@ (markup-to-properties . ,markup-to-properties) (font-family . "roman") (meta . ,(element-description "BarNumber" - text-interface general-element-interface break-aligned-interface)) + text-interface break-aligned-interface)) )) (Beam . ,basic-beam-properties) @@ -73,7 +73,7 @@ (molecule-callback . ,Breathing_sign::brew_molecule) (Y-offset-callbacks . (,Breathing_sign::offset_callback)) (visibility-lambda . ,begin-of-line-invisible) - (meta . ,(element-description "BreathingSign" general-element-interface break-aligned-interface)) + (meta . ,(element-description "BreathingSign" break-aligned-interface)) )) (Clef . ( @@ -83,7 +83,7 @@ (break-align-symbol . Clef_item) (visibility-lambda . ,begin-of-line-visible) (Y-offset-callbacks . (,Staff_symbol_referencer::callback)) - (meta . ,(element-description "Clef" clef-interface break-aligned-interface general-element-interface)) + (meta . ,(element-description "Clef" clef-interface break-aligned-interface )) )) (ChordNames . ( @@ -102,7 +102,7 @@ (axes 0 1) (note-width . 1.65) (meta . ,(element-description "NoteCollision" - general-element-interface note-collision-interface axis-group-interface + note-collision-interface axis-group-interface )) )) @@ -120,7 +120,7 @@ (DotColumn . ( (axes 0 ) - (meta . ,(element-description "DotColumn" dot-column-interface general-element-interface axis-group-interface)) + (meta . ,(element-description "DotColumn" dot-column-interface axis-group-interface)) )) (Dots . ( @@ -128,7 +128,7 @@ (dot-count . 1) (staff-position . 0.0) (Y-offset-callbacks . (,Dots::quantised_position_callback ,Staff_symbol_referencer::callback)) - (meta . ,(element-description "Dots" dot-interface general-element-interface)) + (meta . ,(element-description "Dots" dot-interface )) )) (DynamicText . ( @@ -141,7 +141,7 @@ (markup-to-properties . ,markup-to-properties) (self-alignment-Y . 0) - (meta . ,(element-description "DynamicText" text-interface general-element-interface)) + (meta . ,(element-description "DynamicText" text-interface )) )) (DynamicLineSpanner . ( @@ -190,7 +190,7 @@ (minimum-length . 0.5) (molecule-callback . ,Hyphen_spanner::brew_molecule) (Y-extent-callback . ,Score_element::point_dimension_callback) - (meta . ,(element-description "LyricHyphen" lyric-hyphen-interface general-element-interface)) + (meta . ,(element-description "LyricHyphen" lyric-hyphen-interface )) )) (InstrumentName . ( @@ -203,7 +203,7 @@ (style-to-font-name . ,style-to-font-name) (markup-to-properties . ,markup-to-properties) (font-family . "roman") - (meta . ,(element-description "InstrumentName" general-element-interface text-interface break-aligned-interface)) + (meta . ,(element-description "InstrumentName" text-interface break-aligned-interface)) )) (KeySignature . ( @@ -211,7 +211,7 @@ (break-align-symbol . Key_item) (visibility-lambda . ,begin-of-line-visible) (breakable . #t) - (meta . ,(element-description "KeySignature" key-signature-interface general-element-interface break-aligned-interface)) + (meta . ,(element-description "KeySignature" key-signature-interface break-aligned-interface)) )) (Accidentals . ( @@ -220,12 +220,12 @@ (direction . -1) (left-padding . 0.2) (right-padding . 0.4) - (meta . ,(element-description "Accidentals" general-element-interface accidentals-interface)) + (meta . ,(element-description "Accidentals" accidentals-interface)) )) (LineOfScore . ( (axes . (0 1)) - (meta . ,(element-description "LineOfScore" general-element-interface axis-group-interface)) + (meta . ,(element-description "LineOfScore" axis-group-interface)) )) (LyricExtender . ( @@ -233,7 +233,7 @@ (height . 0.8) ; stafflinethickness; (right-trim-amount . 0.5) (Y-extent-callback . ,Score_element::point_dimension_callback) - (meta . ,(element-description "LyricExtender" general-element-interface lyric-extender-interface)) + (meta . ,(element-description "LyricExtender" lyric-extender-interface)) )) (LyricText . ( @@ -260,7 +260,7 @@ (font-style . mark) (visibility-lambda . ,end-of-line-invisible) (padding . 4.0) - (meta . ,(element-description "RehearsalMark" general-element-interface mark-interface side-position-interface)) + (meta . ,(element-description "RehearsalMark" mark-interface side-position-interface)) )) (MultiMeasureRest . ( @@ -270,16 +270,16 @@ (expand-limit . 10) (padding . 2.0) ; staffspace (minimum-width . 12.5) ; staffspace - (properties-to-font-name . ,properties-to-font-name) - (style-to-font-name . ,style-to-font-name) - (markup-to-properties . ,markup-to-properties) - (font-family . "number") - (meta . ,(element-description "MultiMeasureRest" multi-measure-rest-interface general-element-interface)) + (properties-to-font-name . ,properties-to-font-name) + (style-to-font-name . ,style-to-font-name) + (markup-to-properties . ,markup-to-properties) + (font-family . "number") + (meta . ,(element-description "MultiMeasureRest" multi-measure-rest-interface )) )) (NoteColumn . ( (axes . (0 1)) - (meta . ,(element-description "NoteColumn" general-element-interface axis-group-interface note-column-interface)) + (meta . ,(element-description "NoteColumn" axis-group-interface note-column-interface)) )) (NoteHead . ( @@ -288,7 +288,7 @@ (Y-offset-callbacks . (,Staff_symbol_referencer::callback)) (meta . ,(element-description "NoteHead" rhythmic-head-interface - note-head-interface general-element-interface)) + note-head-interface )) )) (NoteName . ( @@ -316,7 +316,7 @@ (style-to-font-name . ,style-to-font-name) (markup-to-properties . ,markup-to-properties) - (meta . ,(element-description "OctavateEight" text-interface general-element-interface)) + (meta . ,(element-description "OctavateEight" text-interface )) )) (PaperColumn . ( @@ -336,11 +336,11 @@ (minimum-beam-collision-distance . 1.5) (meta . ,(element-description "Rest" rhythmic-head-interface - rest-interface general-element-interface)) + rest-interface )) )) (RestCollision . ( (minimum-distance . 0.75) - (meta . ,(element-description "RestCollision" rest-collision-interface general-element-interface)) + (meta . ,(element-description "RestCollision" rest-collision-interface )) )) (Script . ( @@ -360,7 +360,7 @@ ;; assume that notes at least this long are present. (maximum-duration-for-spacing . ,(make-moment 1 8)) - (meta . ,(element-description "SpacingSpanner" general-element-interface spacing-spanner-interface)) + (meta . ,(element-description "SpacingSpanner" spacing-spanner-interface)) )) (SpanBar . ( @@ -383,7 +383,7 @@ (thin-kern . 3.0) (hair-thickness . 1.6) (thick-thickness . 6.0) - (meta . ,(element-description "SpanBar" span-bar-interface bar-line-interface general-element-interface)) + (meta . ,(element-description "SpanBar" span-bar-interface bar-line-interface )) )) (StanzaNumber . ( @@ -402,7 +402,7 @@ (molecule-callback . ,Staff_symbol::brew_molecule) (staff-space . 1.0) (line-count . 5 ) - (meta . ,(element-description "StaffSymbol" staff-symbol-interface general-element-interface)) + (meta . ,(element-description "StaffSymbol" staff-symbol-interface )) )) (SostenutoPedal . ( (molecule-callback . ,Text_item::brew_molecule) @@ -417,7 +417,7 @@ (markup-to-properties . ,markup-to-properties) (self-alignment-X . 0) - (meta . ,(element-description "SostenutoPedal" text-interface general-element-interface)) + (meta . ,(element-description "SostenutoPedal" text-interface )) )) (Stem . ( @@ -436,7 +436,7 @@ ; if stem is on middle line, choose this direction. (default-neutral-direction . 1) (X-offset-callbacks . (,Stem::off_callback)) - (meta . ,(element-description "Stem" stem-interface general-element-interface)) + (meta . ,(element-description "Stem" stem-interface )) )) (StemTremolo . ( @@ -444,11 +444,11 @@ (beam-width . 2.0) ; staff-space (beam-thickness . 0.42) ; staff-space (beam-space-function . ,default-beam-space-function) - (meta . ,(element-description "StemTremolo" stem-tremolo-interface general-element-interface)) + (meta . ,(element-description "StemTremolo" stem-tremolo-interface )) )) (SeparationItem . ( - (meta . ,(element-description "SeparationItem" separation-item-interface general-element-interface)) + (meta . ,(element-description "SeparationItem" separation-item-interface )) )) (SeparatingGroupSpanner . ( (spacing-procedure . ,Separating_group_spanner::set_spacing_rods) @@ -478,18 +478,18 @@ (arch-width . 1.5) (bracket-thick . 0.25) (bracket-width . 2.0) - (meta . ,(element-description "SystemStartDelimiter" system-start-delimiter general-element-interface)) + (meta . ,(element-description "SystemStartDelimiter" system-start-delimiter )) )) (TextScript . ( (molecule-callback . ,Text_item::brew_molecule) (no-spacing-rods . #t) (padding . 0.5) - (properties-to-font-name . ,properties-to-font-name) - (style-to-font-name . ,style-to-font-name) - (markup-to-properties . ,markup-to-properties) - (font-family . "roman") - (meta . ,(element-description "TextScript" text-script-interface text-interface side-position-interface general-element-interface)) + (properties-to-font-name . ,properties-to-font-name) + (style-to-font-name . ,style-to-font-name) + (markup-to-properties . ,markup-to-properties) + (font-family . "roman") + (meta . ,(element-description "TextScript" text-script-interface text-interface side-position-interface )) )) (TextSpanner . ( (molecule-callback . ,Text_spanner::brew_molecule) @@ -499,7 +499,7 @@ (markup-to-properties . ,markup-to-properties) (type . "line") (direction . 1) - (meta . ,(element-description "TextSpanner" text-spanner-interface general-element-interface)) + (meta . ,(element-description "TextSpanner" text-spanner-interface )) )) (Tie . ( (molecule-callback . ,Tie::brew_molecule) @@ -509,12 +509,12 @@ (thickness . 1.2) (x-gap . 0.2) (minimum-length . 2.5) - (meta . ,(element-description "Tie" tie-interface general-element-interface)) + (meta . ,(element-description "Tie" tie-interface )) )) (TieColumn . ( (after-line-breaking-callback . ,Tie_column::after_line_breaking) - (meta . ,(element-description "TieColumn" tie-column-interface general-element-interface)) + (meta . ,(element-description "TieColumn" tie-column-interface )) )) (TimeSignature . ( @@ -527,7 +527,7 @@ (markup-to-properties . ,markup-to-properties) (font-style . timesig) - (meta . ,(element-description "TimeSignature" time-signature-interface general-element-interface)) + (meta . ,(element-description "TimeSignature" time-signature-interface )) )) (TupletBracket . ( @@ -541,7 +541,7 @@ (markup-to-properties . ,markup-to-properties) (font-shape . "italic") (meta . ,(element-description "TupletBracket" - general-element-interface tuplet-bracket-interface)) + tuplet-bracket-interface)) )) (UnaChordaPdeal . ( @@ -556,7 +556,7 @@ (Y-offset-callbacks . (,Side_position::aligned_side ,Side_position::centered_on_parent)) - (meta . ,(element-description "UnaChordaPedal" text-interface general-element-interface)) + (meta . ,(element-description "UnaChordaPedal" text-interface )) )) (VoltaBracket . ( diff --git a/scm/generate-documentation.scm b/scm/generate-documentation.scm index 345e4da4ed..9f33bdf1e7 100644 --- a/scm/generate-documentation.scm +++ b/scm/generate-documentation.scm @@ -1,4 +1,10 @@ +;;;; +; +; This file generates documentation for the backend of lilypond. +; +;;;; + (define (uniqued-alist alist acc) (if (null? alist) acc @@ -7,18 +13,16 @@ (uniqued-alist (cdr alist) (cons (car alist) acc) )))) - ;;; TODO (define (wordwrap string) "" ) - (define (self-evaluating? x) - (or (number? x) (string? x)) + (or (number? x) (string? x) (procedure? x)) ) - + (define (type-name predicate) (cond ((eq? predicate dir?) "direction") @@ -28,35 +32,65 @@ ((eq? predicate list?) "list") ((eq? predicate symbol?) "symbol") ((eq? predicate string?) "string") - ((eq? predicate boolean?) "string") + ((eq? predicate boolean?) "string") ((eq? predicate number?) "number") + ((eq? predicate char?) "char") + ((eq? predicate input-port?) "input port") + ((eq? predicate output-port?) "output port") + ((eq? predicate vector?) "vector") ((eq? predicate procedure?) "procedure") (else "(unknown)") )) +(define (htmlfy x) + (let* + ((x1 (regexp-substitute/global #f ">" x 'pre ">" 'post)) + (x2 (regexp-substitute/global #f "<" x1 'pre "<" 'post)) + ) + x2)) + (define (scm->string val) (string-append (if (self-evaluating? val) "" "'") - (call-with-output-string (lambda (port) (display val port))) + (htmlfy + (call-with-output-string (lambda (port) (display val port)))) )) (define (document-property prop desc) (let ((handle (assoc (car prop) desc))) (string-append - "\n" (symbol->string (car prop)) " (" (type-name (cadr prop)) ") -- " + "\n
  • " (symbol->string (car prop)) " (" (type-name (cadr prop)) ") -- " (caddr prop) - "\ndefault value: " + "
    default value: " (if (pair? handle) (scm->string (cdr handle)) "not set" ) - "\n" + "\n" ) )) -;; -;; todo: setup ifaces differently. -;; +(define (document-interface interface elt-description) + (let* ((name (car interface)) + (desc (cadr interface)) + (props (caddr interface)) + (docs (map (lambda (x) (document-property x elt-description)) + props)) + ) + + (string-append + "
    " + "

    Interface: " (symbol->string name) "

    \n" + desc + "
    \n" + ) + )) + +; +; generate HTML, return filename. +; (define (document-element description) (let* ((metah (assoc 'meta description)) (meta (if (pair? metah) @@ -65,47 +99,49 @@ )) (name (cdr (assoc 'name meta))) -; (iface-descs (cdr (assoc 'interface-descriptions meta))) - (propdesc (cdr (assoc 'properties meta))) - (docs (map (lambda (x) (document-property x description)) - (uniqued-alist propdesc '()))) + (ifaces (cdr (assoc 'interface-descriptions meta))) + (ifacedoc (map (lambda (x) (document-interface x description)) + ifaces)) + (outname (string-append name ".html")) + (out (open-output-file outname)) ) - - (string-append - "\n-------------------------\n" - name "\n" - "-------------------------\n" - "INTERFACES\n" - "(todo)\n" - ; (apply string-append iface-descs) - "-------------------------\n" - "PROPERTIES:\n" - (apply string-append docs) + (display (string-append "Writing " outname " ... \n") (current-error-port)) + (display + (string-append "LilyPond Element " name " " + "

    " name "

    " + (apply string-append ifacedoc)) + out) + outname ) - )) - + ) (define (document-elements elts) - (string-append - (map (lambda (x) (display (car x)) (document-element (cdr x))) - elts + (let* ((files (map (lambda (x) (document-element (cdr x))) + elts)) + (outname (string-append "backend.html")) + (out (open-output-file outname)) + (l (map (lambda (x) (string-append + "
  • " x "\n")) + files)) ) - )) - -(define (test-module ) - (display - (list - (scm->string '(1 2 abc)) - (scm->string +) - (type-name number?) - (uniqued-alist '((a . 1 ) (a . 1)) '() ) - ))) + (display + (string-append + "LilyPond backend documentation" + "

    LilyPond backend documentation

    " + "" + ) + out + ) + )) +; (display (document-interface stem-interface '())) ; (define b (cdr (assoc 'Beam all-element-descriptions))) ;(display b) -; (display (document-element b)) +;(document-element b) -(display (document-elements all-element-descriptions)) +(document-elements all-element-descriptions) diff --git a/scm/interface.scm b/scm/interface.scm index c5dc2d9d55..d44e4cc729 100644 --- a/scm/interface.scm +++ b/scm/interface.scm @@ -7,12 +7,13 @@ (list symbol type? description)) (define (lily-interface symbol description props) - (list (list symbol) - (list description) + (list symbol + description props ) ) + (define (merge-interfaces ifs) (list (apply append (map car ifs)) @@ -20,16 +21,30 @@ (apply append (map caddr ifs)) )) +(define (uniqued-alist alist acc) + (if (null? alist) acc + (if (assoc (caar alist) acc) + (uniqued-alist (cdr alist) acc) + (uniqued-alist (cdr alist) (cons (car alist) acc) + )))) + (define (element-description name . interfaces) - (let ((merged (merge-interfaces interfaces))) + (let* ((ifs (cons general-element-interface interfaces)) + (props (map caddr ifs)) + (syms (map car ifs)) + ) (list (cons 'separator "\n\n\n") ;easy printing. (cons 'name name) - (cons 'interfaces (car merged)) + (cons 'interfaces syms) + (cons 'interface-descriptions ifs) ; (cons 'interface-descriptions (cadr merged)) ;; description of the element itself? - (cons 'properties (caddr merged)) + (cons 'properties (apply append props)) ))) + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +;;;;;;;;;;;;;;;; ;;;;;;;;;;;;;;;;; (define general-element-interface -- 2.39.5