[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: SCM_CALL_N
From: |
Neil Jerram |
Subject: |
Re: SCM_CALL_N |
Date: |
24 Jun 2001 11:45:28 +0100 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.7 |
>>>>> "Keisuke" == Keisuke Nishida <address@hidden> writes:
Keisuke> I guess the reason for using scm_listofnull is to reduce
Keisuke> consing.
Keisuke> The following two expressions are equivalent
Keisuke> scm_apply (proc, SCM_LIST1 (arg1), SCM_EOL);
Keisuke> scm_apply (proc, arg1, scm_listofnull);
Keisuke> except that the former conses a cell.
Thanks for explaining (yourself and Dirk too). I see now that some of
the complication arises because scm_apply is used in C to achieve the
equivalent of both
(func arg1 arg2 ...)
and
(apply func arg1 arg2 ...)
and because Scheme `apply' has to handle both a variable number of
arguments and its last argument being a list of arguments.
Keisuke> I thought the SCM_CALL_N macros are good because they
Keisuke> abstract the actual calls. I think this is good as long
Keisuke> as we know what they do exactly.
Yes, on reflection, I now agree with you. Perhaps SCM_APPLY_N would
also be useful, where SCM_APPLY_N is defined to take N arguments and a
final list argument:
SCM_APPLY_N (proc, arg1, ..., argN, args)
->
(apply proc arg1 ... argN args)
Then SCM_CALL_N and SCM_APPLY_N would completely encapsulate the
optimization use of scm_listofnull, I think.
Regards,
Neil
- SCM_CALL_N, Keisuke Nishida, 2001/06/22
- Re: SCM_CALL_N, Neil Jerram, 2001/06/22
- Re: SCM_CALL_N, Dirk Herrmann, 2001/06/22
- Re: SCM_CALL_N, Dale P. Smith, 2001/06/22
- Re: SCM_CALL_N, Neil Jerram, 2001/06/24
- Re: SCM_CALL_N, Keisuke Nishida, 2001/06/24
- Re: SCM_CALL_N,
Neil Jerram <=
- Re: SCM_CALL_N, Rob Browning, 2001/06/24
- Re: SCM_CALL_N, Neil Jerram, 2001/06/24
- Re: SCM_CALL_N, Keisuke Nishida, 2001/06/25
- Re: SCM_CALL_N, Marius Vollmer, 2001/06/25
- Re: SCM_CALL_N, Marius Vollmer, 2001/06/25
- Re: SCM_CALL_N, Rob Browning, 2001/06/25
- Re: SCM_CALL_N, Keisuke Nishida, 2001/06/25
- Re: SCM_CALL_N, Marius Vollmer, 2001/06/25
- Re: SCM_CALL_N, Lars J. Aas, 2001/06/26
- Re: SCM_CALL_N, Dirk Herrmann, 2001/06/26