package p5scm
Not available on OCaml 5.5Install
dune-project
Dependency
Authors
Maintainers
Sources
md5=e0fe733bb7a8cccc94bfbbd3b58e6d76
sha512=4f4efad8bb7b2ab5cfc0fff9bb48e45df8e7396d288d52f5c84b53919e1979720bbd909e82e714e1eb6fe8d3b83c14656167199373a197a6082eab2457fea94d
Description
This a simple scheme implementation using pa_schemer from camlp5
Added to opam-repository:
README
A Scheme Implementation using Pa_schemer from Camlp5
This repository contains a scheme implementation based on pa_schemer.ml which is included as an extension of camlp5. This provides a scheme-like syntax for OCaml. The camlp5 documentation for the scheme extension provides the following comparison between OCaml and scheme syntax:
| OCaml | Scheme | ------------------------------------ | ---------------------------------- | let x = 42;; | (define x 42) | let f x = 0;; | (define (f x) 0) | let rec f x y = 0;; | (definerec (f x y) 0) | let x = 42 and y = 27 in x + y;; | (let ((x 42) (y 27)) (+ x y)) | let x = 42 in let y = 27 in x + y;; | (let* ((x 42) (y 27)) (+ x y)) | module M = struct ... end;; | (module M (struct ...)) | type 'a t = A of 'a * int | B | (type (t 'a) (sum (A 'a int) (B))) | fun x y -> x | (lambda (x y) x) | x; y; z | (begin x y z) | f x y | (f x y) | [1; 2; 3] | [1 2 3] | a, b, c | (values a b c) | match x with 'A'..'Z' -> "x" | (match x ((range 'A' 'Z') "x"))) | {x = y; z = t} | {(x y) (z t)}
p5scm also provides the following:
| OCaml | Scheme | ------------------------------------ | ---------------------------------- | [|1; 2; 3|] | #(1 2 3)
which is provided via a simple menhir parser that supports all of the syntax above.
Installation
As long as you have a current version of opam, installation is as simple as:
$ opam install p5scmYou can then use it to parse and emit OCaml bytecode that can then be used in your OCaml project:
$ p5scm file1.scmYou can also start an interpreter for p5scm:
$ p5sch-utopwhich uses utop for code completion and many of the other benefits that it provides. Currently both the #require and #use directives of utop function in the interpreter/REPL (same syntax as utop however no terminating ;; required).
Only OCaml versions >= 4.12.0 are supported by the opam package. Instructions for adding support for older versions can be found (here).
License
Dependencies (8)
-
utop
>= "2.7.0" -
ppx_sexp_conv
>= "v0.14.0" -
sexp_pretty
>= "v0.14.0" -
camlp5
>= "8.04.00" -
cppo
>= "1.6.6" -
menhir
>= "20201214" -
ocaml
>= "4.12.0" & < "5.5.0" -
dune
>= "2.8"
Dev Dependencies (1)
-
odoc
with-doc
Optional Dependencies
None
Used by
None
Conflicts
None
Build status
Results of building p5scm with each compiler on check.ci.ocaml.org, run of against opam-repository 7cdc698. All results for this package.
Each result links to its build log. To keep crawlers from overloading the site, build logs require a GitHub sign-in (see ocurrent/opam-health-check). On your first log, GitHub asks you to “Authorize opam-health-check”, the OCurrent app that runs these checks; it sees only your public profile, not your repositories. The sign-in lasts 30 days.
| Version | OCaml 4.11 | OCaml 4.14 | OCaml 5.2 | OCaml 5.4 | OCaml 5.5 |
|---|---|---|---|---|---|
| 0.5.0 (this version) | n/a | good | good | good | n/a |
- good Package successfully built
- partial One of the dependencies failed to build
- bad Package failed to build
- n/a Package is not available in this environment
- internal Internal failure