Re: [code] [textadept] Key module and Menu module

From: Mitchell <m.att.foicica.com>
Date: Wed, 3 Jul 2019 18:43:11 -0400 (EDT)

Hi,

On Wed, 3 Jul 2019, Qwerky wrote:

> Thanks.  Presently, menu.lua calls functions directly, and keys.lua (besides
> already calling some functions directly) calls menu entries which then call
> functions.  What if those keys.lua functions simply called the same functions
> which the menu entries call, so that neither keys.lua or menu.lua would call
> the other? 

This isn't exactly true. *keys.lua* and *menu.lua* both call the same functions. It's something like:

   menu = {'foo', function() print('foo') end}
   key = menu[2]

Both `menu` and `key` use the same exact function value. It's just that `key` references `menu` to get it. From my understanding, you are proposing something like:

   function foo() print('foo') end
   menu = {'foo', foo}
   key = foo

The two examples are equivalent, minus a global `foo()` function. I wouldn't know the best place to define `foo()` outside of *menu.lua* in order for *keys.lua* not to need it. (It certainly cannot be a global function.)

Sorry if I'm misunderstanding you.

Cheers,
Mitchell

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Wed 03 Jul 2019 - 18:43:11 EDT

This archive was generated by hypermail 2.2.0 : Thu 04 Jul 2019 - 06:31:01 EDT