Where it is right now:
use Inline::Guile; my $g = Inline::Guile.new; say $g.run_i('(+ 3 7)'); # 10 say $g.run_s('"boo"'); # 'boo'
Where it will go soon:
say $g.run('(+ 3 7)'); say $g.run('"boo"');
After Slang::Guile has been written:
use Slang::Guile; guile-sub car( $x ) { car $x } guile-sub cdr( $x ) { cdr $x } use Test; is car <a b c>, 'a'; is-deeply [ cdr <a b c> ], ['b', 'c'];
I've already figured out how to write the helper code for most of this. Writing the C glue code at compile time using Perl 6 will let me share constants between C, Guile and Perl 6. Two problems I can foresee with this are that strings will need to be surrounded with dynwind-protect so that they don't leak from the Guile interpreter, and I don't think the NativeCall array types support arbitrarily-recursive arrays, I.E. CArrayInt is just a flat array of entries. I can solve this by passing back a typed array of int32s like so:
(3 "a" (7 9) "after") => ( INTEGER, 3, STRING, "a", START-LIST, Nil, INTEGER, 7, INTEGER, 9, EN +D-LIST, Nil, STRING, "after" )
so that everything is returned in a homogeneous data structure, and it's up to the Perl 6 layer to unswizzle this back to:
is-deeply \$g.run(q{'(3 "a" (7 9) "after")}), [ 3, "a", [ 7, 9 ], "after" ];
Hopefully I'll have time around FOSDEM to put this all together.

In reply to Introducing Scheme In Perl 6 by DrForr

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.