lua Questions

3

Solved

for example function foo1() local i=10 --or just i=10 end The variable i is not visible out of the function. So should I declare it as local explicitly. Or It's already a local variable.
lua
Rearrange asked 14/7, 2014 at 4:37

2

Solved

According to this page: http://luarocks.org/en/Creating_a_rock This should be saved in a file called luafruits-1.0-1.rockspec. The name must contain lowercase versions of the "package" and "ver...
Dissolute asked 11/8, 2013 at 22:51

2

Solved

I'm configuring neovim with none-ls and when I'm trying to add eslint_d to the setup I have this error : [null-ls] failed to load builtin eslint_d for method diagnostics; please check your config H...
Uncouple asked 5/3, 2024 at 13:35

1

I am running a docker with lua-nginx image. In my Nginx conf file I call the lua script from server { } section: server { listen 80; server_name _; location /payload { content_by_lua_file /etc...
Titillate asked 8/3, 2021 at 10:11

3

Does Pandoc expose variables set on the command line (pandoc -V foo=bar) to scripts running inside the built in lua filter environment? In other words if I run: pandoc -V foo=bar --lua-filter=myfi...
Peak asked 31/1, 2019 at 10:19

5

Solved

I want to exit the execution of a Lua script on some condition. For example: content = get_content() if not content then -- ( Here i want some kind of exit function ) next_content = get_content() ...
lua
Villanelle asked 25/11, 2013 at 9:22

15

I'm currently using Neovim 6.0. And I also use the following neovim-config : https://github.com/rafi/vim-config. After installation, I created a python program to test and a problem encountered wh...
Negris asked 16/12, 2021 at 3:54

4

Solved

Does Lua provide a function to make the first character in a word uppercase (like ucfirst in php) and if so, how to use it? I want keywords[1] to be first letter uppercase. I've read that string.u...
Churr asked 11/3, 2010 at 0:18

8

First I'll show you an example of what I am talking about: GUI Example I've been studying Lua for around a week now, and I'm really curious of how I would do this. Basically (for now, and learning...
Distraint asked 5/8, 2013 at 11:2

14

I'm trying to make a simple script for a game, by changing the time of day, but I want to do it in a fast motion. So this is what I'm talking about: function disco ( hour, minute) setTime ( 1, 0 )...
Cottrell asked 1/8, 2013 at 7:23

6

Solved

Im following "ThePrimeagen" tutorial on setting up NeoVim (https://www.youtube.com/watch?v=w7i4amO_zaE), but Im stuck at 3:13 where he ":so" (sources) the file. In my case I get...
Irvin asked 2/5, 2023 at 0:14

5

Solved

my current line number colors I like to have a very visible line number coloring and I couldn't find a way to configure it in v0.8.2 of Neovim. I'm using tokionight-night as my color theme and wou...
Handcart asked 29/1, 2023 at 19:56

1

Solved

string.find("MOZ-MAIL-1-1","MOZ-MAIL-") string.find("MOZ-MAIL-1-1","OZ-MAIL-") Given the above, why do those return false, but the following succeed? string...
Pout asked 31/5, 2024 at 0:46

5

Solved

Given a string s in Lua: s = "abc123" If the string is non-empty, I want to store the first character of this string in a variable s1, else store nothing. I've tried the following, but b...
Ritzy asked 7/3, 2017 at 14:3

3

I'm new to Lua, and need to know how to install it on Windows? I've tried and am unable to run the sample. When I try to compile it 100% success is shown, but when I click the run button it shows t...
Appliance asked 22/5, 2013 at 11:55

6

Solved

How can I write a Unicode symbol in lua. For example I have to write symbol with 9658 when I write string.char( 9658 ); I got an error. So how is it possible to write such a symbol.
Longlegged asked 2/11, 2011 at 16:10

4

Solved

Like in python I can use slice. Like following b=[1,2,3,4,5] a=b[0:3] Can I do that kind of operation in Lua without a loop. Or Loop is the most efficient way to do that
lua
Violoncello asked 18/7, 2014 at 8:58

15

Which is the best efficient way to round up a number and then truncate it (remove decimal places after rounding up)? for example if decimal is above 0.5 (that is, 0.6, 0.7, and so on), I want to r...
Proffer asked 19/8, 2013 at 11:54

4

Solved

Is it possible to achieve in Lua? local noSlashEnding = string.gsub("slash\\ending\\string\\", "\\|/$", "") -- noSlashEnding should contain "slash\\ending\\string" local noSlashEnding2 = string.g...
Poona asked 11/8, 2010 at 20:9

7

Solved

I need a Torch command that checks if two tensors have the same content, and returns TRUE if they have the same content. For example: local tens_a = torch.Tensor({9,8,7,6}); local tens_b = torch....
Malita asked 7/10, 2015 at 15:25

5

Solved

Even though Lua does not differentiate between floating point numbers and integers, there are some cases when you want to use integers. What is the best way to covert a number to an integer if you ...
Crick asked 11/3, 2012 at 11:24

11

Solved

Sounds like a "let me google it for you" question, but somehow I can't find an answer. The Lua # operator only counts entries with integer keys, and so does table.getn: tbl = {} tbl["test"] = 47 t...
lua
Dugong asked 24/4, 2010 at 19:10

2

Solved

I'm using IMAPFilter, and I'd like to keep my global configuration in a public repository, while keeping the local (and secret) configuration in a separate file. So I'm running imapfilter from some...
Figureground asked 11/5, 2011 at 8:56

22

I need to do a simple split of a string, but there doesn't seem to be a function for this, and the manual way I tested didn't seem to work. How would I do it?
Nonrigid asked 15/9, 2009 at 12:42

15

Solved

Many will found that this is repeating questions but i have gone through all the questions before asked about this topic but none worked for me. I want to print full path name of the certain...
Padraic asked 7/12, 2014 at 6:33

© 2022 - 2025 — McMap. All rights reserved.