lilypond-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: scheme max/min in c++


From: Mark Knoop
Subject: Re: scheme max/min in c++
Date: Fri, 19 Aug 2016 12:55:51 +0100

At 11:37 on 19 Aug 2016, Carl Sorensen wrote:
>>From: Mark Knoop <address@hidden>
>>
>>Just trying out some more ideas for the keep-alive-together-engraver.
>>How do I use the Guile max/min functions on a scheme list in C++? I
>>have tried this:
>>
>>SCM this_layer = group_spanners_[i]->get_property ("remove-layer");
>>SCM this_max;
>>if (scm_is_pair (this_layer))
>>  {
>>    this_max = scm_apply_0 (scm_max, this_layer);
>>  }
>>
>>...but the compiler returns:
>>
>>  error: cannot convert 'scm_unused_struct* (*)(SCM, SCM) {aka
>>  scm_unused_struct* (*)(scm_unused_struct*, scm_unused_struct*)}' to
>>  'SCM {aka scm_unused_struct*}' for argument '1' to
>> 'scm_unused_struct* scm_apply_0(SCM, SCM)'
>>
>Shouldn't you be using scm_apply_1?

Thanks Carl. But scm_apply_1 would require an additional arg1, which I
don't have/need. I'm just looking to replicate what this would do in
Scheme:

(define this_layer (list 1 2 3))
(apply max this_layer)
==> 3

--
Mark Knoop



reply via email to

[Prev in Thread] Current Thread [Next in Thread]