[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Programmatically creating functions
From: |
aartist |
Subject: |
Re: Programmatically creating functions |
Date: |
Tue, 21 Oct 2008 11:22:16 -0700 (PDT) |
User-agent: |
G2/1.0 |
Do you think that skeleton or macro can help?
On Oct 21, 1:26 pm, Ian Eure <i...@digg.com> wrote:
> So, I have a list of symbols:
>
> '(foo bar baz)
>
> I want to iterate over the list and create a function from each which
> does something like this:
>
> (defun call-foo ()
> (interactive)
> (invoke-stuff 'foo)
>
> How can I accomplish this? I can't figure out how to create the
> function. I've tried a number of approaches, but have not met with
> success.
>
> - eval'ing the defun. Returns a function symbol, but I can't call
> it. Maybe it's only created within the scope of the (eval) and not
> callable from outside?
>
> - Creating a symbol and using fset to assign a lambda to it's
> function cell. It sort of works, but I'm unclear on how to pass a
> variable function name to defun, nor am I clear on how I can make sure
> it calls invoke-stuff with the right symbol.
>
> Help?
>
> - Ian