On 2020-02-06 8:35 am, Paolo Prete wrote:
I ask you if is it possible to remove the noisy default #OSSPW param as
well, in the function call.

Default arguments cannot be in the final position, which is why you have to specify the value.

Consider whether you can reorder arguments or add an extra argument to ensure a non-optional final parameter.

Another option would be to accept height and width in the same argument using a custom type predicate:

%%%%
\version "2.19.83"

#(define (number-or-number-pair? x) (or (number? x) (number-pair? x)))

foo = #(define-scheme-function (arg) (number-or-number-pair?)
  (let ((width (if (pair? arg) (car arg) 0))
        (height (if (pair? arg) (cdr arg) arg)))
    #{ \markup #(format #f "width=~a, height=~a" width height) #}))

\foo 1
\foo #'(2 . 3)
%%%%


-- Aaron Hill

Reply via email to