In order to continue my dive into reading real code, I'd like to read and understand the source code of an actual in-use compiler. Is there one that you think is particularly well-written, elegant, and perhaps, still relatively small? Any suggestions? Any experiences?
Resolution: I've decided to read the Lua source code. I've been bookm...
Hi, I have to program a game engine starting very soon for a 3rd year Games technology project. As a part of our project we have to integrate a scripting language for scripting our NPCs and other elements of the game.
I know that Lua has been very popular in recent years and Python has horrible white space issues, however it is making a...
Hello, I come from classes object orientation languages and recently I have been learning those fancy dynamic languages (JavaScript, Python and Lua) and I want some tips about how to use OO in those languages. It would be useful to know the pitfalls and the shortcomings of such approach and the advantages compared to traditional OO.
The...
I'm trying to use wxFTP on wxLua to upload several files. It works with the 1st file, but I do not understand why I cannot send a 2nd file. Here is a sample that fails :
local ftp = wx.wxFTP()
local ftpAddress = wx.wxIPV4address()
ftpAddress:Service( "ftp" )
ftpAddress:Hostname( "ftp.example.com" )
ftp:Connect( ftpAddress )
local out1 =...
Are there any scientific packages for Lua comparable to Scipy?
Thanks for your time and help :)
...
From my understanding, Lua is an embeddable scripting language that can execute methods on objects. What are the pitfalls to avoid? Is is it feasible to use Lua as an interpreter and execute methods in an web environment or as a rule engine?
...
In my scenario I want to interpret a script file and execute methods from assemblies. What advantages would Lua offer me? If you have used both Lua and the CSharpCodeProvider please contrast your experience with both.
...
Could you, please, give a code snippet showing how to use Lua embedded in OCaml?
A simple example could be a "Hello, World" variant. Have OCaml prompt the user for a name. Then pass that name to a Lua function. Have Lua print a greeting and return the length of the name. Then have OCaml print a message about the length of the name.
...
The other day, I tweaked a script for a friend's World of Warcraft addon. He was surprised that you could edit the addons—that they were "open source." (Word of Warcraft addons are written in the Lua scripting language) I found myself wanting to say "Sure you can—all scripts are 'open source'."
Is that true? Sure, some scripts can be co...
Hi,
In C++, I have a map<string, string>, containing an unknown number of entries. How can I pass this to a Lua function, so that the Lua function can use the data as a table?
Hugo
...
Consider the following lua code snippet :
local time = os.time()
for _= 1, 10 do
time = time + 1
print('Seeding with ' .. time)
math.randomseed(time)
for i = 1, 5 do
print('\t' .. math.random(100))
end
end
On a Linux machine, the result is, as expected, random numbers. But it seems that at least on Mac OS X, t...
Hi!
Just tried to execute a small Lua script, but unfortunately I'm doing something wrong. I've no more ideas what the fault might be.
function checkPrime( n )
for i = 2, n-1, 1 do
if n % i == 0 then
return false
end
end
return true
end
The interpreter says:
lua: /home/sebastian/luatest/test.l...
Hi, another Lua question: Is there a common way to get the current time in or with milliseconds?
There is os.time(), but it only provides full seconds.
...
Does anyone know how to fix the Lua syntax highlighting in Kdevelop. The # symbol used to get the length of a table causes the remainder of the line to appear as if it is commented out.
t[#t+1] = "foo"
...
I have a program that generates text fiels that can be up to 20 mets in size. Sometimes I only care about the last line in the file, is there a way to read just that line with out wasting memory reading the rest of the file?
...
Is there a library like Rails for Lua?
...
Hi all,
I am developing, in C++, a Computer Aided Design package for Printed Circuit Boards and Schematics (aka EDA CAD). It uses Lua for some specific things, but I would like to expand the role of Lua so that it implements much of the user interface logic.
I would like to re-build the internals in a way which lets people change the ...
I'm going back to the basics here but in Lua, you can define a table like so:
myTable = {}
myTable [1] = 12
Printing the table reference itself brings back a pointer to it. To access its elements you need to specify an index (i.e. exactly like you would an array)
print(myTable ) --prints pointer
print(myTable[1]) --prints 12
N...
Can anyone explain how compilation works?
I can't seem to figure out how compilation works..
To be more specific, here's an example.. I'm trying to write some code in MSVC++ 6 to load a Lua state..
I've already:
set the additional directories for the library and include files to the right directories
used extern "C" (because Lua i...
Anyone know of any examples that shows COM programming via Lua? Could require a library.
I need to write some external scripts for Photoshop, so wondering if it's possible with Lua.
...