Next: , Previous: , Up: Top   [Contents][Index]


1 Overview of the package

This document describes version 0.1.0-devel.0 of MMCK Infix, a CHICKEN language library implementing an infix–to–prefix macro. CHICKEN is a Scheme-to-C compiler supporting the language features as defined in the “Revised^5 Report on Scheme”.

This package supports POSIX platforms. This package depends upon the CHICKEN egg coops. To run the tests distributed with the source code: this package depends upon the package MMCK Checks.

The package installs the library (mmck infix) along with its import libraries. To require the library and import its syntactic bindings in a module we can do:

(declare (unit my-module)
         (emit-import-library my-module))

(require-library (mmck infix))

(module (my-module)
    ()
  (import (scheme)
          (mmck infix))

  ...

  #| end of module |# )

The defined infix macro allow us to evaluate forms like:

(infix atan(1, 2))      → (atan 1 2)
(infix 1 + 2 + 3)       → (+ (+ 1 2) 3)
(infix 1 + 2 * 3)       → (+ 1 (* 2 3))
(infix (1 + 2) * 3)     → (* (+ 1 2) 3)

(infix 2 expt 3 expt 4) → (expt 2 (expt 3 4))
(infix 2 ** 3 ** 4)     → (expt 2 (expt 3 4))

(infix - 5)             → (- 5)
(infix + 5)             → (+ 5)
(infix 5 !)             → (factorial 5)

(infix 1 > 2 ? 3 + 4 : 5 * 6)
→ (if (> 1 2) (+ 3 4) (* 5 6))

(define a 1)
(define b 2)
(define c 3)
(infix cos(a) * tan(b) / c)
→ (/ (* (cos a) (tan b)) c)

Next: , Previous: , Up: Top   [Contents][Index]

This document describes version 0.1.0-devel.0 of MMCK Infix.