aboutsummaryrefslogtreecommitdiffstats
path: root/README.md
blob: 96a5fd20ab29d5f544941f24f11db5f71958f00b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
# SRFI-259 for CHICKEN

This is an implementation of SRFI-259 for CHICKEN.

Notable features:

* Different than `extend-procedure`, because `extend-procedure` is
  stateful.
* Uses an efficient set type (integer maps) to store tags.

This is the first time I've written low-level CHICKEN code: use at your own
risk.

## Usage

Import `(srfi 259)` for only the standard bindings. Import
`(srfi 259 extensions)` for the SRFI-259 macro and the extensions
described below.

## Extensions

This library implements lambdas with object scope.

    (lambda/this this formal body ...)

Create a procedure such that `this` will be bound to the current
procedure.  When a new procedure is created using a tag constructor,
`this` will point to the new procedure, not to the old procedure. This
allows for a procedure to inspect its own tags.

    (procedure/this? obj)

Returns true if `obj` is a procedure created using `lambda/this`.