Inline::MzScheme

Inline module for the PLT MzScheme interpreter
Download

Inline::MzScheme Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Autrijus Tang
  • Publisher web site:
  • http://search.cpan.org/~autrijus/

Inline::MzScheme Tags


Inline::MzScheme Description

Inline module for the PLT MzScheme interpreter Inline::MzScheme is a Perl module that allows you to add blocks of Scheme code to your Perl scripts and modules.All user-defined procedures in your Scheme code will be available as Perl subroutines; association lists and hash tables are available as Perl hash refereces; lists and vectors available as array references; boxed values become scalar references.Perl subroutines in the same package are imported as Scheme primitives, as long as they are declared before the use Inline MzScheme line.Non-word characters in Scheme identifiers are turned into _ for Perl. Underscores in Perl identifiers are turned into - for Scheme.Additional objects, classes and procedures may be imported into Scheme, by passing them as config parameters to use Inline. See Inline for details about this syntax.You can invoke perl objects in Scheme code with the syntax: (object 'method arg1 arg2 ...)If your method takes named argument lists, this will do: (object 'method 'key1 val1 'key2 val2)For information about handling MzScheme data in Perl, please see Language::MzScheme. This module is mostly a wrapper around Language::MzScheme::scheme_eval_string with a little auto-binding magic for procedures and input variables.SYNOPSIS use subs 'perl_multiply'; # have to declare before Inline runs use Math::BigInt; use Inline MzScheme => q{ (define (square x) (perl-multiply x x)) (define assoc-list '((1 . 2) (3 . 4) (5 . 6))) (define linked-list '(1 2 3 4 5 6)) (define hex-string (bigint 'as_hex)) }, (bigint => Math::BigInt->new(1792)); sub perl_multiply { $_ * $_ } print square(10); # 100 print $hex_string; # 0x700 print $assoc_list->{1}; # 2 print $linked_list->; # 4 Requirements: · Perl


Inline::MzScheme Related Software