Re: [code] Weirdness with external libraries and Textadept 7.0

From: Robert Gieseke <rob.g.att.web.de>
Date: Thu, 07 Nov 2013 09:24:06 +0100

Am 11/7/13, 9:05 AM, schrieb Michael Richter:
> I'm trying to expand my pastes.lua file to support other pastebin sites.
> Unfortunately many of these sites use JSON in their APIs.
> (gist.github.comfor example.) I've tried to get any number of JSON
> libraries for Lua
> working with Textadept 7.0 and I'm getting nowhere fast, to wit:
>
> 1. lua-json has, in one single, solitary file, a "module" statement
> that's making Textadept throw its hands up in disgust and give up on
> actually working.

Textadept uses Lua 5.2 and is not compiled with backwards compatibility
options. You could certainly update the module by removing the module
statement adding
M = {}
at the top of the file
return M
at the bottom and pre-fixing all functions that need to be exported with
M., e.g.
function M.encode

There might be other incompatibilites (have a link for the JSON module
you're using?), but this might be enough to get this working.

> 2. lua-cjson, when its .so file is where Textadept looks for it, won't
> work because it can't find lua_pcall (!) which is a particularly odd error
> given that lua_pcall is a standard Lua API call.
>
This is likely the same reason. You could try a 5.2 build if you find one.

> I'm kind of at a loss here. How does one go about getting either of these
> (or any other JSON library people may know about) working with Textadept?
>

The just linked dkjson library has 5.2 mentioned so it should work, but
this might be helpful for you if you want to use other libraries.

Robert

-- 
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 Thu 07 Nov 2013 - 03:24:06 EST

This archive was generated by hypermail 2.2.0 : Thu 07 Nov 2013 - 06:42:19 EST