MSK Software Development

Tag: LUA

LUAInterface 0.9

by admin on Apr.27, 2009, under Smalltalk

I’ve published a new source code version. The last version only worked against an own compiled LUA interpreter version. This has been changed - from version 0.9 on I develop against the “official” distributed Windows version. At this time it is version 5.1.4.

You may download this version from LUA and pick up both libraries from that distribution and put them into the bin-directory of your VASmalltalk 8.0 version.

Most of the - minor - changes were needed due to this official 5.1.4 distribution and I had to recode some functions, because the logic was implemented as macros within the c library and not in functions (as in my own LUA library distribution).

Leave a Comment :, , more...

LuaInterface 0.3

by parc on Jul.20, 2008, under Smalltalk

Several APIs added to set and retrieve values within the LUA environment. Several tests added.

Here are some examples, which are also included within the tests:

The idea of the first example shows, how a LUA script is executed (actually it is created within Smalltalk) and then the interpreter is asked for the value of a variable changed in that script.

| src aNumber |
  src := WriteStream on: String new.
  aNumber := Time now asMilliseconds.
  "First we create LUA souce which looks like w = 137482374"
  src
    nextPutAll: 'w = ' ; nextPutAll: aNumber printString ; cr.
  "then we execue it which sets w to an integer value"
  lua
    doString: src contents.
  "then we query the interpreter for the value of 'w'"
  lua
    getGlobalNamed: 'w'.
  "and we check if its an integer and we check the value"
  self
    assert: ((lua isNumber: -1) ) ;
    assert: ((lua toInteger: -1) = aNumber).

The next script sets the value of a LUA variable BEFORE executing LUA script. The script itselfs just returns the value set before executing the script:

| src aNumber |

aNumber := Time now asMilliseconds.
src := WriteStream on: String new.
src
  nextPutAll: 'return w' ; cr.
"we set the value in the new interpreter environment"
lua
  pushInteger: aNumber ;
  setGlobalNamed: 'w' ;
"then we execute the code created above - simply returning the value again"
  doString: src contents.
"... and checking the results"
self assert: ((lua isNumber: -1) ).
self assert: ((lua toInteger: -1) = aNumber).

Download:

msklua-03

Leave a Comment :, , more...

Lua Interface 0.2

by parc on Jul.20, 2008, under Smalltalk

Additional function calls added, additional tests added … the archive contains the whole Lua source code suitable for Watcom 1.7 to compile. You must rename lua.dll to lua5.1.dll and put it into the bin directory of your VASmalltalk directory.

msklua-02

Leave a Comment :, , more...

LUA Interface 0.1

by parc on Jul.18, 2008, under Smalltalk

First version based on LUA 5.1.3 - this version is compiled via Watcom 1.7a and the library now includes all functions in cdecl-calling-conventions (decorated and not decorated) and stdcall-calling-conventions (not decorated). Therefore this version is usable with VASmalltalk. This library also can be called without the need of having VS2005 c runtime library and changing the manifest file of VASmalltalk.

This is highly pre-alpha-software …

msklua-01

Leave a Comment :, , more...

LuaInterface 0.0.5

by parc on Jul.15, 2008, under Smalltalk

Code slightly updated:

* exception handling introduced
* a few additional API functions wrapped
* tests added

Here’s the code:

luainterface-0-0-5

Leave a Comment :, , more...

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!

Visit our friends!

A few highly recommended friends...