John provided an alternative, but here are the explanations of the errors
you got:

On Fri, Nov 28, 2014 at 5:14 PM, Andrea Ferretti <ferrettiand...@gmail.com>
wrote:

>   { { c-string } } [ "hello world" swap example_cp ] with-out-parameters
>
The syntax of with-out-parameters is an array of elements, which are either
a c-type, or a triple { c-type intial: value }. So in your case, it should
have been
  { c-string } [ "hello world" swap example_cp ] with-out-parameters

I get "index out of bounds: 0" which seems reasonable, since I pass an
> empty c-string. But if I try something like
>
>   { { c-string initial: "hello earth" } } [ "hello world" swap
> example_cp ] with-out-parameters
>
> I get "local-allocation-error".
>
The FFI only works with the optimizing compiler, so this code should be
defined in a word, not run in the interactive listener. You can define the
word in a source file, or directly in the listener and then call it just
after you defined it


Cheers,
Jon
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=157005751&iu=/4140/ostg.clktrk
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to