[Top][All Lists]

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

scm_apply_1() vs. scm_apply()

From: Alexei Matveev
Subject: scm_apply_1() vs. scm_apply()
Date: Wed, 14 Nov 2012 11:31:16 +0100

Hi, All,

I see interface of scm_apply_1() and scm_apply() are the same
and dont get the difference [1]. I've read the description several times
but today is simply not my day. What is the intended difference?

I was about to add a generic scm_apply() to Fortran but it dispatches
on types/kinds/ranks of the arguments which are the same for these two.



Relevant quote:

— Scheme Procedure: apply proc arg ... arglst
— C Function: scm_apply_0 (proc, arglst)
— C Function: scm_apply_1 (proc, arg1, arglst)
— C Function: scm_apply_2 (proc, arg1, arg2, arglst)
— C Function: scm_apply_3 (proc, arg1, arg2, arg3, arglst)
— C Function: scm_apply (proc, arg, rest)

Call proc with arguments arg ... and the elements of the arglst list.

scm_apply takes parameters corresponding to a Scheme level (lambda
(proc arg1 . rest) ...). So arg1 and all but the last element of the
rest list make up arg ..., and the last element of rest is the arglst
list. Or if rest is the empty list SCM_EOL then there's no arg ...,
and (arg1) is the arglst.

arglst is not modified, but the rest list passed to scm_apply is modified.

reply via email to

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