[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
help with Wrong type of argument
From: |
Jeff Olson |
Subject: |
help with Wrong type of argument |
Date: |
Sun, 30 Apr 2023 23:00:00 -0600 |
User-agent: |
Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.10.0 |
I'm starting to translate some of my \postscript markups into lilypond
in order to use cairo, and it seems I always stub my toe when trying to
use a variable in a substitution function.
In this example I'm trying to do (lineto 0 hgt) which fails with "In
procedure *: Wrong type argument in position 1: hgt".
But it works if I replace hgt with a constant: (lineto 0 2).
My cargo cult thinking was that this lineto command was in a scheme
expression so I shouldn't use a # or $ before the hgt variable to
reference it (like the xtip and ytip inside the cons).
I'd welcome a quick syntax fix or a reference to what I should have read
before asking.
TIA,
Jeff
Here's my code (small if not minimal):
\version "2.24.0"
#(define-markup-command (dopath layout props xtip ytip hgt wid txt rot)
(number? number? number? number? string? number?)
(let (
(a (* wid 0.4))
)
(interpret-markup layout props
#{\markup \translate #(cons xtip ytip) \rotate #rot \path #0.25
#'((lineto 0 hgt)
(closepath))
#})))
\markup \dopath #10 #0 #2 #1 "D" #-5
- help with Wrong type of argument,
Jeff Olson <=