From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,f5a3111843eb37e2 X-Google-Attributes: gid103376,public,usenet X-Google-Language: ENGLISH,ASCII Path: g2news1.google.com!news3.google.com!out04b.usenetserver.com!news.usenetserver.com!in04.usenetserver.com!news.usenetserver.com!in03.usenetserver.com!news.usenetserver.com!pc03.usenetserver.com!news.flashnewsgroups.com-b7.4zTQh5tI3A!not-for-mail Newsgroups: comp.lang.ada Subject: Re: Questions on using prgma Import (C, foo) References: <487a5f28-32d3-4bf6-921c-72c40c40b76e@41g2000hsc.googlegroups.com> <47C316E1.9010009@obry.net> From: Stephen Leake Date: Tue, 26 Feb 2008 08:50:51 -0500 Message-ID: User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/22.1 (windows-nt) Cancel-Lock: sha1:0J7zOU/2hOo3iW/pK4RqGRDQESc= MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Complaints-To: abuse@flashnewsgroups.com Organization: FlashNewsgroups.com X-Trace: 5c92147c41707e05e48ed32301 Xref: g2news1.google.com comp.lang.ada:20086 Date: 2008-02-26T08:50:51-05:00 List-Id: pfpearson.net@gmail.com writes: > On Feb 25, 1:28 pm, Pascal Obry wrote: >> pfpearson....@gmail.com a �crit : >> >> > However, it only took me a minute to realize that this won't work. >> > I see two options: >> > 1. function lua_tolstring (...) return System.Adddress; >> > 2. use the types declared in Interfaces.C.Strings. >> >> 2 is better I think: >> >> function lua_tolstring >> (L : lua_State_ptr; >> index : inteter; >> len : size_t_ptr) return Interfaces.C.Strings.chars_ptr; >> >> Pascal. > > That's what I suspected. Thanks. You should also consider providing a slightly thicker wrapper that does the conversion from Interfaces.C.Strings.chars_ptr to Standard.String; that will make this easier to use with plain Ada programs. > Once I've gotten this done, is anyone interested in using this? Lua > really is a neat embedded langauge. I hope to use it at work to > handle reading in init data, and possibly to script some of the > program's behavior. Lua is used by monotone (http://monotone.ca), a distributed configuration management system, that I'm starting to use. So I'm also starting to use Lua. It is a nice languaged, well designed for embedding in larger projects. Lua has a website: http://www.lua.org/ I'm not clear on how it manages dynamically allocated memory; that would be a concern for some embedded systems. I'm currently using OpenToken to build my own language for controlling my simulator. That language has no control structures or subroutines. I might consider switching to Lua to gain those things. -- -- Stephe