help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: Calling different kinds of functions, which finish the same job


From: Herbert Euler
Subject: Re: Calling different kinds of functions, which finish the same job
Date: Wed, 12 Apr 2006 01:31:24 +0800

From: Kevin Rodgers <ihs_4664@yahoo.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Calling different kinds of functions, which finish the same job
Date: Tue, 11 Apr 2006 09:49:29 -0600

[This doesn't belong on emacs-devel]

OK.  Sorry for having sent to emacs-devel.

What are "args of f1" etc? They are apparently not the arguments to a single call to f1, since you have these variations:

(apply ,func) ; this is tried first
(apply ,func (car ,largs)) ; then this is tried, while cdr'ing down largs

If all of the functions are defined, why would any of the function call signal an error? Why do you care which function is actually called? You certainly don't return that information, you only return the result of the first non-error-signalling call.

Suppose functions f1, f2, and f3 are all for inserting one space, but
without side effect or with different side effect;  f1 requires an
integeral argument as count, f2 requires an symbolic argument specifies
how the side effect is caused, and f3 requires two arguments, one
of them is an integer, the other one is a symbol.  Now, if I want to
insert one space (either with or without side effect), I can issue one
of the following commands:

   (f1 1)
   (f2 'indent)
   (f3 1 'indent)

And I'm granteed that, if one space is inserted, one of f1, f2, f3 is
called, but I don't which one is called.  So I want I can write (with
function in my last post),

   (xgp-casi2-safe-call f '((1) (indent) (1 indent)))

Where f is one of f1, f2, or f3 (got from environment).  If f can be
self-insert-command as well, the first trial will be successful  (so
perhaps I should make invoking without arguments the last trial).

Any better solutions?  Thanks.

Regards,
Guanpeng Xu

_________________________________________________________________
Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/





reply via email to

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