Re: [code] [textadept] History for TA

From: Qwerky <mr.qwerky.att.gmail.com>
Date: Tue, 30 Jul 2019 12:45:56 -0600

Hi Mitchell,

On 2019-07-30 12:14, Mitchell wrote:
> Hi,
>
> On Tue, 30 Jul 2019, Qwerky wrote:
>
>> A question that your step 3 and '_M.history' brought to mind:  as a
>> relatively new user, I am somewhat confused by using 'M.function' or
>> 'M.variable' in the module, as opposed to 'local function' or 'local
>> variable'.  What is the difference between the two?
>
> The `M.` prefix makes those fields accessible outside the module (e.g.
> from one's *~/.textadept/init.lua*). If those fields were local, they
> are not accessible from the outside.
>
> Cheers,
> Mitchell

I had a suspicion that it was something along those lines.  But try as I
might, I couldn't figure out 'how' to access them from outside.  I would
think it would require the module name, but no matter what I try, I get
errors, such as "attempt to access global 'history'" or similar.  So how
is that done?

And that would apply to both functions and variables?  And I would
assume that even though externally accessibly, that they are still not
global (which is good), otherwise there would be no difference between
the 'M.' version and a global one.

qwerky

-- 
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 Tue 30 Jul 2019 - 14:45:56 EDT

This archive was generated by hypermail 2.2.0 : Wed 31 Jul 2019 - 06:48:47 EDT