On 10/19/11 3:26 AM, "David Kastrup" <d...@gnu.org> wrote: >Štěpán Němec <step...@gmail.com> writes: > >> On Wed, 19 Oct 2011 10:22:09 +0200 >> David Kastrup wrote: >> >>> What would people prefer for creating a Lilypond function that returns >>> an "unspecified" value (what the Guile read-eval-print loop takes as a >>> hint to print nothing at all) and is called for its side effect? >>> >>> define-void-function or define-procedure? The first is a bit more >>> C-ish, the second more Pascal-ish. I am not going to consider >>> define-subroutine though. >> >> Given that in the Scheme world, "procedure" is the standard term for >> functions in general, `define-procedure' would IMO be a rather >> unfortunate name for something used to define _only_ that subset of >> procedures which return an unspecified value, if that's what you mean. > >Ok. Now unfortunately, Guile has a number of functions that one would >expect to return SCM_UNSPECIFIED, but which return something else.
><snip> > There is also >\ignore #(hashq-set! ... >but it sounds a bit like nothing would happen. >\do #(hashq-set! ... >looks nice, but due to namespace pollution, it is already taken by >Guile, quite like \eval. > >All in all, I can't think of anything better than \ignore. An >alternative syntax like ##(...) or ##[...] seems a bit too sneaky to >me. One other possibility would be \void. It might look a bit nicer: > >\void #(hashq-set! ...) >\void #(hashq-set! ...) > >rather than > >\ignore #(hashq-set! ...) >\ignore #(hashq-set! ...) > >It's a bit C-ish, but not all that bad, and it fits with >define-void-function. \returnUnspecified #(hashq-set! ...) \scmUnspecified #(hashq-set! ...) \ignoreReturn #(hashq-set! ...) After all I can think of, I think \void is probably the best. Thanks, Carl _______________________________________________ lilypond-devel mailing list lilypond-devel@gnu.org https://lists.gnu.org/mailman/listinfo/lilypond-devel